Skip to main content

Backend

Trait Backend 

Source
pub trait Backend: Sized {
    // Required methods
    fn get(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<Option<Vec<u8>>, String>>;
    fn put(
        &self,
        name: &str,
        bytes: &[u8],
    ) -> impl Future<Output = Result<(), String>>;
    fn delete(&self, name: &str) -> impl Future<Output = Result<(), String>>;
    fn list(&self) -> impl Future<Output = Result<Vec<(String, u64)>, String>>;
    fn staging(&self) -> impl Future<Output = Result<Self, String>>;
    fn rename(
        &self,
        name: &str,
        to: &Self,
    ) -> impl Future<Output = Result<(), String>>;
}
Expand description

Named byte storage. A put is whole or absent: no reader ever sees half of one.

Required Methods§

Source

fn get( &self, name: &str, ) -> impl Future<Output = Result<Option<Vec<u8>>, String>>

Source

fn put( &self, name: &str, bytes: &[u8], ) -> impl Future<Output = Result<(), String>>

Source

fn delete(&self, name: &str) -> impl Future<Output = Result<(), String>>

Source

fn list(&self) -> impl Future<Output = Result<Vec<(String, u64)>, String>>

Every name held, with its size in bytes.

Source

fn staging(&self) -> impl Future<Output = Result<Self, String>>

An area of its own beside this one’s names, which no other store writes and list never names.

Source

fn rename( &self, name: &str, to: &Self, ) -> impl Future<Output = Result<(), String>>

name moved from here into to in one step, over whatever to held under it.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§