Trait sanakirja::LoadPage [−][src]
pub trait LoadPage { type Error; fn load_page(&self, off: u64) -> Result<CowPage, Self::Error>; fn rc(&self, _off: u64) -> Result<u64, Self::Error> { ... } }
Expand description
Trait for loading a page.
Associated Types
Required methods
Provided methods
fn rc(&self, _off: u64) -> Result<u64, Self::Error>
[src]
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.