Trait b_tree::Schema

source ·
pub trait Schema: Eq + Debug {
    type Error: Error + From<Error>;
    type Value: Clone + Eq + Send + Sync + Debug + 'static;

    // Required methods
    fn block_size(&self) -> usize;
    fn len(&self) -> usize;
    fn order(&self) -> usize;
    fn validate(
        &self,
        key: Key<Self::Value>
    ) -> Result<Key<Self::Value>, Self::Error>;
}
Expand description

The schema of a B+Tree

Required Associated Types§

source

type Error: Error + From<Error>

source

type Value: Clone + Eq + Send + Sync + Debug + 'static

Required Methods§

source

fn block_size(&self) -> usize

Get the maximum size in bytes of a leaf node in a B+Tree with this Schema.

source

fn len(&self) -> usize

Get the number of columns in this Schema.

source

fn order(&self) -> usize

Get the order of the nodes in a B+Tree with this Schema.

source

fn validate( &self, key: Key<Self::Value> ) -> Result<Key<Self::Value>, Self::Error>

Return a validated version of the given key, or a validation error.

Implementors§