RKTK API Docs RKTK Home Repo

Trait StorageDriver

Source
pub trait StorageDriver {
    type Error: Error;

    // Required methods
    async fn format(&self) -> Result<(), Self::Error>;
    async fn read<const N: usize>(
        &self,
        key: u64,
        buf: &mut [u8],
    ) -> Result<(), Self::Error>;
    async fn write<const N: usize>(
        &self,
        key: u64,
        buf: &[u8],
    ) -> Result<(), Self::Error>;
}
Expand description

Storage driver interface

Required Associated Types§

Required Methods§

Source

async fn format(&self) -> Result<(), Self::Error>

Source

async fn read<const N: usize>( &self, key: u64, buf: &mut [u8], ) -> Result<(), Self::Error>

Source

async fn write<const N: usize>( &self, key: u64, buf: &[u8], ) -> Result<(), Self::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§