Skip to main content

ListHandle

Struct ListHandle 

Source
pub struct ListHandle { /* private fields */ }
Expand description

Owner-held handle to one list inside a ChunkPool.

12 bytes, Copy — meant to be embedded in a fixed-size record. The handle is the list: the pool keeps no directory, so losing the handle leaks the chain until the owner’s compaction pass rebuilds the pool. A handle is only meaningful with the pool that filled it; passing it to another pool reads unrelated (but initialized) chunks.

Implementations§

Source§

impl ListHandle

Source

pub const EMPTY: Self

An empty list.

Source

pub fn len(&self) -> u32

Number of values pushed into the list.

Source

pub fn is_empty(&self) -> bool

true when nothing has been pushed.

Source

pub fn to_bytes(self) -> [u8; 12]

Serializes the handle into 12 bytes: [head BE | tail BE | len BE].

This is the stable wire form — owners embed handles inside their own fixed-size records (and, later, snapshots), so the encoding is part of the crate’s format contract and is fixed by tests.

Source

pub fn from_bytes(bytes: [u8; 12]) -> Self

Inverse of ListHandle::to_bytes.

The bytes are trusted bookkeeping, not validated content: a handle is only meaningful with the pool that produced it (same rule as the in-memory value — see the type docs).

Trait Implementations§

Source§

impl Clone for ListHandle

Source§

fn clone(&self) -> ListHandle

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 Copy for ListHandle

Source§

impl Debug for ListHandle

Source§

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

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

impl Default for ListHandle

Source§

fn default() -> Self

Source§

impl Eq for ListHandle

Source§

impl PartialEq for ListHandle

Source§

fn eq(&self, other: &ListHandle) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ListHandle

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.