Trait flatcontainer::Region
source · pub trait Region: Default {
type Owned;
type ReadItem<'a>: IntoOwned<'a, Owned = Self::Owned>
where Self: 'a;
type Index: Index;
// Required methods
fn merge_regions<'a>(
regions: impl Iterator<Item = &'a Self> + Clone,
) -> Self
where Self: 'a;
fn index(&self, index: Self::Index) -> Self::ReadItem<'_>;
fn reserve_regions<'a, I>(&mut self, regions: I)
where Self: 'a,
I: Iterator<Item = &'a Self> + Clone;
fn clear(&mut self);
fn heap_size<F: FnMut(usize, usize)>(&self, callback: F);
fn reborrow<'b, 'a: 'b>(item: Self::ReadItem<'a>) -> Self::ReadItem<'b>
where Self: 'a;
}
Expand description
A region to absorb presented data and present it as a type with a lifetime.
This type absorbs data and provides an index to look up an equivalent representation of this data at a later time. It is up to an implementation to select the appropriate presentation of the data, and what data it can absorb.
Implement the Push
trait for all types that can be copied into a region.
Required Associated Types§
Required Methods§
sourcefn merge_regions<'a>(regions: impl Iterator<Item = &'a Self> + Clone) -> Selfwhere
Self: 'a,
fn merge_regions<'a>(regions: impl Iterator<Item = &'a Self> + Clone) -> Selfwhere
Self: 'a,
Construct a region that can absorb the contents of regions
in the future.
sourcefn index(&self, index: Self::Index) -> Self::ReadItem<'_>
fn index(&self, index: Self::Index) -> Self::ReadItem<'_>
Index into the container. The index must be obtained by pushing data into the container.
sourcefn reserve_regions<'a, I>(&mut self, regions: I)
fn reserve_regions<'a, I>(&mut self, regions: I)
Ensure that the region can absorb the items of regions
without reallocation
Object Safety§
This trait is not object safe.