Skip to main content

SpanPool

Struct SpanPool 

Source
pub struct SpanPool<T: Copy + Default> { /* private fields */ }

Implementations§

Source§

impl<T: Copy + Default> SpanPool<T>

Source

pub fn data(&self) -> &[T]

The whole backing buffer (published zero-copy as a scene slab).

Source

pub fn get(&self, span: Span<T>) -> &[T]

Source

pub fn try_get(&self, span: Span<T>) -> Option<&[T]>

Source

pub fn live(&self) -> usize

Elements currently referenced by live spans.

Source

pub fn live_capacity(&self) -> usize

Total backing-slab slots occupied by live spans (including power-of-two size-class rounding).

Source

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.

Source

pub fn free(&mut self, span: Span<T>)

Releases span, resetting its slots (no-op for empty spans).

Source

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.

Source

pub fn insert_at(&mut self, span: Span<T>, at: usize, elem: T) -> Span<T>

Inserts elem at at (clamped to span.len) in place when the capacity class fits, or migrates to the next class — zero heap allocations beyond slab growth.

Source

pub fn remove_at(&mut self, span: Span<T>, at: usize) -> Span<T>

Removes the element at at in place, shrinking to a smaller class if the class drops.

Trait Implementations§

Source§

impl<T: Clone + Copy + Default> Clone for SpanPool<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + Copy + Default> Debug for SpanPool<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Copy + Default> Default for SpanPool<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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>
where T: Send, RawVecInner: Send,

§

impl<T> Sync for SpanPool<T>
where T: Sync, RawVecInner: Sync,

§

impl<T> Unpin for SpanPool<T>
where T: Unpin, *const u8 is !null: Unpin,

§

impl<T> UnsafeUnpin for SpanPool<T>

§

impl<T> UnwindSafe for SpanPool<T>
where RawVecInner: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.