Skip to main content

Adapter

Trait Adapter 

Source
pub trait Adapter: Send + 'static {
    type Target: BlanketAdapter<Target = Self>;

    // Provided methods
    fn write_state<S: State>(&self, state: &S) -> Result<(), JoydbError> { ... }
    fn load_state<S: State>(&self) -> Result<S, JoydbError> { ... }
}
Expand description

A trait that every adapter must implement. Adapter determines how to write and how to load the state from the file system (or any other storage).

A concrete adapter must be implemented either though UnifiedAdapter or PartitionedAdapter.

Required Associated Types§

Source

type Target: BlanketAdapter<Target = Self>

Provided Methods§

Source

fn write_state<S: State>(&self, state: &S) -> Result<(), JoydbError>

Write the state to the file system or any other storage.

Source

fn load_state<S: State>(&self) -> Result<S, JoydbError>

Load the state from the file system or any other storage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§