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§
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>>
Sourcefn list(&self) -> impl Future<Output = Result<Vec<(String, u64)>, String>>
fn list(&self) -> impl Future<Output = Result<Vec<(String, u64)>, String>>
Every name held, with its size in bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".