Trait b_tree::Schema

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

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

The schema of a B+Tree

Required Associated Types§

source

type Error: Error + Send + Sync + 'static

The type of error returned by Schema::validate_key

source

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

The type of value stored in a B+Tree’s keys

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_key( &self, key: Vec<Self::Value> ) -> Result<Vec<Self::Value>, Self::Error>

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

Object Safety§

This trait is not object safe.

Implementors§