Trait CollectExactMeshExt

Source
pub trait CollectExactMeshExt<T>: ExactSizeIterator<Item = T> + Sized {
    // Required method
    fn collect_exact_mesh<M>(self, region: Region) -> Result<M, M::Error>
       where M: BuildFromRegion<T>,
             M::Error: From<InvalidCardinality>;
}
Expand description

Exact-size, mesh-aware collecting adapter.

Like CollectMeshExt, but for ExactSizeIterator. Performs a len() pre-check to fail fast (no allocation) when len() != region.num_ranks(). On success, constructs M without re-validating cardinality.

Required Methods§

Source

fn collect_exact_mesh<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> CollectExactMeshExt<T> for I
where I: ExactSizeIterator<Item = T> + Sized,

Blanket impl: enables .collect_exact_mesh(region) on any ExactSizeIterator of T.