pub struct BumpSlice<T> { /* private fields */ }
Expand description
A slice in an arena: like a BumpVec
, but has a fixed size that
cannot grow. The size of this struct is one 32-bit word smaller
than BumpVec
. It is copyable/cloneable because it will never be
freed.
Implementations§
Source§impl<T> BumpSlice<T>
impl<T> BumpSlice<T>
Sourcepub fn as_slice<'a>(&'a self, arena: &'a BumpArena<T>) -> &'a [T]
pub fn as_slice<'a>(&'a self, arena: &'a BumpArena<T>) -> &'a [T]
Returns a slice view of the BumpSlice
, given a borrow of the
arena.
Sourcepub fn as_mut_slice<'a>(
&'a mut self,
arena: &'a mut BumpArena<T>,
) -> &'a mut [T]
pub fn as_mut_slice<'a>( &'a mut self, arena: &'a mut BumpArena<T>, ) -> &'a mut [T]
Returns a mutable slice view of the BumpSlice
, given a
mutable borrow of the arena.
Trait Implementations§
impl<T: Copy> Copy for BumpSlice<T>
Auto Trait Implementations§
impl<T> Freeze for BumpSlice<T>
impl<T> RefUnwindSafe for BumpSlice<T>where
T: RefUnwindSafe,
impl<T> Send for BumpSlice<T>where
T: Send,
impl<T> Sync for BumpSlice<T>where
T: Sync,
impl<T> Unpin for BumpSlice<T>where
T: Unpin,
impl<T> UnwindSafe for BumpSlice<T>where
T: UnwindSafe,
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