Trait sanakirja::Storable[][src]

pub trait Storable: Debug {
    type PageReferences: Iterator;
    fn page_references(&self) -> Self::PageReferences;

    fn compare<T>(&self, _txn: &T, _b: &Self) -> Ordering
    where
        T: LoadPage
, { ... } }
Expand description

Types that can be stored on disk. This trait may be used in conjunction with Sized in order to determine the on-disk size, or with UnsizedStorable when special arrangements are needed.

Associated Types

type PageReferences: Iterator[src]

An iterator over the offsets to pages contained in this value. Only values from this crate can generate non-empty iterators, but combined values (like tuples) must chain the iterators returned by method page_offsets.

Required methods

fn page_references(&self) -> Self::PageReferences[src]

If this value is an offset to another page at offset offset, return Some(offset). Return None else.

Provided methods

fn compare<T>(&self, _txn: &T, _b: &Self) -> Ordering where
    T: LoadPage
[src]

This is required for B trees, not necessarily for other structures. The default implementation panics.

Implementations on Foreign Types

impl Storable for i8[src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <i8 as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &i8) -> Ordering[src]

impl Storable for [u8; 16][src]

impl Storable for u16[src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <u16 as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &u16) -> Ordering[src]

impl Storable for u8[src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <u8 as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &u8) -> Ordering[src]

impl Storable for ()[src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <() as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &()) -> Ordering[src]

impl Storable for [u8][src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <[u8] as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &[u8]) -> Ordering[src]

impl Storable for u32[src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <u32 as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &u32) -> Ordering[src]

impl Storable for u64[src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <u64 as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &u64) -> Ordering[src]

impl Storable for i16[src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <i16 as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &i16) -> Ordering[src]

impl Storable for i32[src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <i32 as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &i32) -> Ordering[src]

impl Storable for i64[src]

type PageReferences = Empty<u64>

pub fn page_references(&self) -> <i64 as Storable>::PageReferences[src]

pub fn compare<T>(&self, &T, b: &i64) -> Ordering[src]

Implementors