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§
type Target: BlanketAdapter<Target = Self>
Provided Methods§
Sourcefn write_state<S: State>(&self, state: &S) -> Result<(), JoydbError>
fn write_state<S: State>(&self, state: &S) -> Result<(), JoydbError>
Write the state to the file system or any other storage.
Sourcefn load_state<S: State>(&self) -> Result<S, JoydbError>
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".