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
impl ListHandle
Sourcepub fn to_bytes(self) -> [u8; 12]
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.
Sourcepub fn from_bytes(bytes: [u8; 12]) -> Self
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
impl Clone for ListHandle
Source§fn clone(&self) -> ListHandle
fn clone(&self) -> ListHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ListHandle
Source§impl Debug for ListHandle
impl Debug for ListHandle
Source§impl Default for ListHandle
impl Default for ListHandle
Source§fn default() -> Self
fn default() -> Self
Same as ListHandle::EMPTY.