Skip to main content

OverflowChain

Struct OverflowChain 

Source
pub struct OverflowChain<'p, P: PageStore> { /* private fields */ }
Expand description

Chain operations over a pager.

Held by value rather than as impl Pager methods to keep overflow concerns out of engine::pager. Slice E will hold one of these from inside the B-tree write path.

Implementations§

Source§

impl<'p, P: PageStore> OverflowChain<'p, P>

Source

pub fn new(pager: &'p P) -> Self

Source

pub fn store(&self, bytes: &[u8]) -> Result<(u32, u64), OverflowError>

Allocate enough overflow pages to hold bytes, link them, and return the head page id together with the total length.

Empty input still produces a single zero-length head page so that the leaf-side pointer is always valid.

Source

pub fn read( &self, head_page_id: u32, total_len: u64, ) -> Result<Vec<u8>, OverflowError>

Walk the chain and return the concatenated payload.

total_len must match the actual bytes carried by the chain; if it does not, a LengthMismatch error is returned (no truncation, no silent extension).

Source

pub fn free(&self, head_page_id: u32) -> Result<(), OverflowError>

Walk the chain starting at head_page_id and return every page to the free list.

Auto Trait Implementations§

§

impl<'p, P> Freeze for OverflowChain<'p, P>
where &'p P: Freeze,

§

impl<'p, P> RefUnwindSafe for OverflowChain<'p, P>

§

impl<'p, P> Send for OverflowChain<'p, P>
where &'p P: Send,

§

impl<'p, P> Sync for OverflowChain<'p, P>
where &'p P: Sync,

§

impl<'p, P> Unpin for OverflowChain<'p, P>
where &'p P: Unpin,

§

impl<'p, P> UnsafeUnpin for OverflowChain<'p, P>

§

impl<'p, P> UnwindSafe for OverflowChain<'p, P>

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.