pub struct ForwardMapping(/* private fields */);Expand description
A mapping to re-order items in an Arena, ArenaSlice or ArenaStr.
Implementations§
Source§impl ForwardMapping
impl ForwardMapping
Sourcepub fn identity(count: u32) -> Self
pub fn identity(count: u32) -> Self
Creates a new identity mapping with the given number of items.
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Checks wether this mapping is the identity.
Sourcepub fn map<T: ?Sized, Storage>(
&self,
index: Interned<T, Storage>,
) -> Interned<T, Storage>
pub fn map<T: ?Sized, Storage>( &self, index: Interned<T, Storage>, ) -> Interned<T, Storage>
Maps the given interned handle to a handle for the re-ordered arena.
Sourcepub fn map_slice<T>(&self, index: InternedSlice<T>) -> InternedSlice<T>
pub fn map_slice<T>(&self, index: InternedSlice<T>) -> InternedSlice<T>
Maps the given interned handle to a handle for the re-ordered arena.
Sourcepub fn map_str(&self, index: InternedStr) -> InternedStr
pub fn map_str(&self, index: InternedStr) -> InternedStr
Maps the given interned handle to a handle for the re-ordered arena.
Sourcepub fn compose(self, other: Self) -> Self
pub fn compose(self, other: Self) -> Self
Returned a composition of this mapping followed by the other mapping.
The composition is such that for any interned handle index,
map1.compose(map2).map(index) is equal to map2.map(map1.map(index)).
Sourcepub fn count_remapped(&self) -> usize
Available on crate feature debug only.
pub fn count_remapped(&self) -> usize
debug only.Returns the number of items that are remapped by this mapping.
Auto Trait Implementations§
impl Freeze for ForwardMapping
impl RefUnwindSafe for ForwardMapping
impl Send for ForwardMapping
impl Sync for ForwardMapping
impl Unpin for ForwardMapping
impl UnsafeUnpin for ForwardMapping
impl UnwindSafe for ForwardMapping
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more