pub trait AttributeBind:
Debug
+ Sized
+ Any {
type StorageType: AttributeStorage<Self>;
type IdentifierType: From<DartIdType> + ToPrimitive + Clone;
const BIND_POLICY: OrbitPolicy;
}
Expand description
Generic attribute trait for support description
This trait can be implemented for a given attribute in order to hint at which components of the map the attribute is bound.
§Example
Using the same context as the for the AttributeUpdate
example, we can associate temperature
to faces if we’re modeling a 2D mesh:
use honeycomb_core::prelude::{AttributeBind, AttributeUpdate, FaceIdType, OrbitPolicy};
use honeycomb_core::attributes::AttrSparseVec;
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Temperature {
pub val: f32
}
impl AttributeBind for Temperature {
type StorageType = AttrSparseVec<Self>;
type IdentifierType = FaceIdType;
const BIND_POLICY: OrbitPolicy = OrbitPolicy::Face;
}
Required Associated Constants§
Sourceconst BIND_POLICY: OrbitPolicy
const BIND_POLICY: OrbitPolicy
OrbitPolicy
determining the kind of topological entity to which the attribute
is associated.
Required Associated Types§
Sourcetype StorageType: AttributeStorage<Self>
type StorageType: AttributeStorage<Self>
Storage type used for the attribute.
Sourcetype IdentifierType: From<DartIdType> + ToPrimitive + Clone
type IdentifierType: From<DartIdType> + ToPrimitive + Clone
Identifier type of the entity the attribute is bound to.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl<T: CoordsFloat> AttributeBind for Vertex2<T>
impl<T: CoordsFloat> AttributeBind for Vertex2<T>
Attribute support definitions
- BINDS TO 0-CELLS
const BIND_POLICY: OrbitPolicy = OrbitPolicy::Vertex
type StorageType = AttrSparseVec<Vertex2<T>>
type IdentifierType = u32
Source§impl<T: CoordsFloat> AttributeBind for Vertex3<T>
impl<T: CoordsFloat> AttributeBind for Vertex3<T>
Attribute support definitions
- BINDS TO 0-CELLS