Trait cosmic::widget::canvas::path::lyon_path::AttributeStore

source ·
pub trait AttributeStore {
    // Required methods
    fn get(&self, id: EndpointId) -> &[f32];
    fn num_attributes(&self) -> usize;
}
Expand description

Interface for objects storing custom attributes associated with endpoints.

This interface can be implemented by path objects themselves or via external data structures.

Required Methods§

source

fn get(&self, id: EndpointId) -> &[f32]

Returns the endpoint’s custom attributes as a slice of 32 bits floats.

The size of the slice must be equal to the result of num_attributes().

source

fn num_attributes(&self) -> usize

Returns the number of float attributes per endpoint.

All endpoints must have the same number of attributes.

Implementations on Foreign Types§

source§

impl AttributeStore for ()

source§

fn get(&self, _: EndpointId) -> &[f32]

source§

fn num_attributes(&self) -> usize

Implementors§