Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§