Trait IsTopologyUnit

Source
pub trait IsTopologyUnit {
    // Required methods
    fn n_vids() -> usize;
    fn vid(&self, index: usize) -> Result<VId>;

    // Provided method
    fn for_each_vid(&self, f: &mut dyn FnMut(VId)) { ... }
}
Expand description

IsTopologyUnit trait used for single units of a topology. E.g. size 1 for paths, size 3 for tri meshes, size 4 for quad meshes

Required Methods§

Source

fn n_vids() -> usize

Should return the number of indices a unit is defined with. (e.g. 3 for a tri mesh)

Source

fn vid(&self, index: usize) -> Result<VId>

Should return the vertex id of the nth element of this unit. Failure if index out of bounds

Provided Methods§

Source

fn for_each_vid(&self, f: &mut dyn FnMut(VId))

Applies the provided function to all indices within this unit

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§