Struct cranelift_egraph::BumpSlice
source · 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.