Trait Mesh

Source
pub trait Mesh {
    type Node;
    type Id: RemoteMessage;
    type Sliced<'a>: Mesh<Node = Self::Node> + 'a
       where Self: 'a;

    // Required methods
    fn shape(&self) -> &Shape;
    fn select<R: Into<Range>>(
        &self,
        label: &str,
        range: R,
    ) -> Result<Self::Sliced<'_>, ShapeError>;
    fn get(&self, index: usize) -> Option<Self::Node>;
    fn id(&self) -> Self::Id;

    // Provided method
    fn iter(&self) -> MeshIter<'_, Self>  { ... }
}
Expand description

A mesh of nodes, organized into the topology described by its shape (see Shape).

Required Associated Types§

Source

type Node

The type of the node contained in the mesh.

Source

type Id: RemoteMessage

The type of identifiers for this mesh.

Source

type Sliced<'a>: Mesh<Node = Self::Node> + 'a where Self: 'a

The type of a slice of this mesh. Slices should not outlive their parent mesh.

Required Methods§

Source

fn shape(&self) -> &Shape

The shape of this mesh.

Source

fn select<R: Into<Range>>( &self, label: &str, range: R, ) -> Result<Self::Sliced<'_>, ShapeError>

Sub-slice this mesh, specifying the included ranges for the dimension with the labeled name.

Source

fn get(&self, index: usize) -> Option<Self::Node>

Retrieve contained node at the provided index. The index is relative to the shape of the mesh.

Source

fn id(&self) -> Self::Id

The global identifier for this mesh.

Provided Methods§

Source

fn iter(&self) -> MeshIter<'_, Self>

Iterate over all the nodes in this mesh.

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§