Trait CollectIndexedMeshExt

Source
pub trait CollectIndexedMeshExt<T>: Iterator<Item = (usize, T)> + Sized {
    // Required method
    fn collect_indexed<M>(self, region: Region) -> Result<M, M::Error>
       where M: BuildFromRegionIndexed<T>;
}
Expand description

Indexed collecting adapter.

Consume (rank, value) pairs plus a Region and build a mesh via BuildFromRegionIndexed.

Implementations of BuildFromRegionIndexed are expected to enforce:

  • Coverage: every rank in 0..region.num_ranks() is provided at least once.
  • Bounds: any out-of-bounds rank (rank >= num_ranks) is an error.
  • Duplicates: allowed; last write wins.
  • Missing ranks: an error (incomplete coverage).

§Errors

Propagates whatever BuildFromRegionIndexed::build_indexed returns (e.g., a cardinality/bounds error) from the target mesh type.

See also: BuildFromRegionIndexed for the authoritative policy.

Required Methods§

Source

fn collect_indexed<M>(self, region: Region) -> Result<M, M::Error>

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<I, T> CollectIndexedMeshExt<T> for I
where I: Iterator<Item = (usize, T)> + Sized,

Blanket impl: enables .collect_indexed(region) on any iterator of (usize, T) pairs.