Trait sanakirja::LoadPage[][src]

pub trait LoadPage {
    type Error;
    pub fn load_page(&self, off: u64) -> Result<CowPage, Self::Error>;

    pub fn rc(&self, _off: u64) -> Result<u64, Self::Error> { ... }
}

Trait for loading a page.

Associated Types

Loading content...

Required methods

pub fn load_page(&self, off: u64) -> Result<CowPage, Self::Error>[src]

Loading a page.

Loading content...

Provided methods

pub fn rc(&self, _off: u64) -> Result<u64, Self::Error>[src]

Reference-counting. Since reference-counts are designed to be storable into B trees by external allocators, pages referenced once aren’t stored, and hence are indistinguishable from pages that are never referenced. The default implementation returns 0.

This has the extra benefit of requiring less disk space, and isn’t more unsafe than storing the reference count, since we aren’t supposed to hold a reference to a page with “logical RC” 0, so storing “1” for that page would be redundant anyway.

Loading content...

Implementors

impl<E: Borrow<Env>> LoadPage for Txn<E>[src]

type Error = Error

fn load_page(&self, off: u64) -> Result<CowPage, Self::Error>[src]

Find the appropriate map segment

impl<E: Borrow<Env>, A> LoadPage for MutTxn<E, A>[src]

type Error = Error

Loading content...