DataStorage

Trait DataStorage 

Source
pub trait DataStorage {
    type Error;
    type Id;

    // Required methods
    fn save_data(
        &mut self,
        reader: &mut (impl AsyncRead + Unpin),
    ) -> impl Future<Output = Result<Self::Id, Self::Error>>;
    fn read_data(
        &self,
        id: &Self::Id,
        range: Range<u64>,
    ) -> impl Future<Output = Result<Bytes, Self::Error>>;
}

Required Associated Types§

Required Methods§

Source

fn save_data( &mut self, reader: &mut (impl AsyncRead + Unpin), ) -> impl Future<Output = Result<Self::Id, Self::Error>>

Source

fn read_data( &self, id: &Self::Id, range: Range<u64>, ) -> impl Future<Output = Result<Bytes, 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§