pub struct SpanPool<T: Copy + Default> { /* private fields */ }Implementations§
Source§impl<T: Copy + Default> SpanPool<T>
impl<T: Copy + Default> SpanPool<T>
pub fn get(&self, span: Span<T>) -> &[T]
pub fn try_get(&self, span: Span<T>) -> Option<&[T]>
Sourcepub fn live_capacity(&self) -> usize
pub fn live_capacity(&self) -> usize
Total backing-slab slots occupied by live spans (including power-of-two size-class rounding).
Sourcepub fn try_reserve_data(
&mut self,
min_cap: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve_data( &mut self, min_cap: usize, ) -> Result<(), TryReserveError>
Pre-sizes the contiguous backing slab fallibly so bulk loads (such as Frame-0 boot) avoid repeated geometric reallocations without aborting on untrusted hints.
Sourcepub fn free(&mut self, span: Span<T>)
pub fn free(&mut self, span: Span<T>)
Releases span, resetting its slots (no-op for empty spans).
Sourcepub fn replace(&mut self, span: Span<T>, src: &[T]) -> Span<T>
pub fn replace(&mut self, span: Span<T>, src: &[T]) -> Span<T>
Replaces the contents of span with src, reusing its slots when the size class allows.
Returns the new span.
Trait Implementations§
Auto Trait Implementations§
impl<T> Forget for SpanPool<T>
impl<T> Freeze for SpanPool<T>
impl<T> Move for SpanPool<T>
impl<T> RefUnwindSafe for SpanPool<T>where
T: RefUnwindSafe,
impl<T> Send for SpanPool<T>
impl<T> Sync for SpanPool<T>
impl<T> Unpin for SpanPool<T>
impl<T> UnsafeUnpin for SpanPool<T>
impl<T> UnwindSafe for SpanPool<T>where
RawVecInner: UnwindSafe,
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