pub trait CollectMeshExt<T>: Iterator<Item = T> + Sized {
// Required method
fn collect_mesh<M>(self, region: Region) -> Result<M, M::Error>
where M: BuildFromRegion<T>;
}
Expand description
Mesh-aware collecting adapter.
Unlike FromIterator
, this trait takes both an iterator and a
Region
to build a mesh:
- Meshes always require a shape (
Region
) supplied externally. - Cardinality must match: the iterator must yield exactly
region.num_ranks()
items, or an error is returned. - Construction goes through
BuildFromRegion
, which validates and builds the concrete mesh type.
In short: collect_mesh
does for meshes what collect
does for
ordinary collections, but with shape-awareness and validation.
Required Methods§
fn collect_mesh<M>(self, region: Region) -> Result<M, M::Error>where
M: BuildFromRegion<T>,
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§
impl<I, T> CollectMeshExt<T> for I
Blanket impl: enables .collect_mesh(region)
on any iterator of
T
.