honeycomb_core::attributes

Trait AttributeBind

Source
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§

Source

const BIND_POLICY: OrbitPolicy

OrbitPolicy determining the kind of topological entity to which the attribute is associated.

Required Associated Types§

Source

type StorageType: AttributeStorage<Self>

Storage type used for the attribute.

Source

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>

Attribute support definitions

  • BINDS TO 0-CELLS
Source§

impl<T: CoordsFloat> AttributeBind for Vertex3<T>

Attribute support definitions

  • BINDS TO 0-CELLS