Trait Merge

Source
pub trait Merge {
    // Required method
    fn merge(&mut self, other: Self) -> &mut Self;

    // Provided methods
    fn merge_iter(iterable: impl IntoIterator<Item = Self>) -> Self
       where Self: Default { ... }
    fn merge_vec(vec: Vec<Self>) -> Self
       where Self: Default { ... }
    fn merge_slice(slice: &[Self]) -> Self
       where Self: Clone + Default { ... }
}
Expand description

A trait describing the action of merging mutltiple objects into a single object of the same type. This represents the inverse of splitting a mesh into components of the same type.

Required Methods§

Source

fn merge(&mut self, other: Self) -> &mut Self

Merge another object into self and return the resulting merged object as a mutable reference.

Provided Methods§

Source

fn merge_iter(iterable: impl IntoIterator<Item = Self>) -> Self
where Self: Default,

Merge an iterator of objects into one of the same type.

Source

fn merge_vec(vec: Vec<Self>) -> Self
where Self: Default,

Merge a Vec of objects into one of the same type.

Source

fn merge_slice(slice: &[Self]) -> Self
where Self: Clone + Default,

In contrast to merge_vec, this function takes an immutable reference to a collection of meshes, and creates a brand new mesh that is a union of all the given meshes.

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: Real> Merge for PointCloud<T>

Source§

impl<T: Real> Merge for PolyMesh<T>

Source§

impl<T: Real> Merge for TetMesh<T>

Source§

impl<T: Real> Merge for TetMeshExt<T>

Source§

impl<T: Real> Merge for QuadMesh<T>

Source§

impl<T: Real> Merge for QuadMeshExt<T>

Source§

impl<T: Real> Merge for TriMesh<T>

Source§

impl<T: Real> Merge for TriMeshExt<T>

Source§

impl<T: Real> Merge for Mesh<T>