pub struct LocalBackend { /* private fields */ }Expand description
A storage backend that persists files to a directory on disk and keeps a metadata index in memory.
Implementations§
Trait Implementations§
Source§impl StorageBackend for LocalBackend
impl StorageBackend for LocalBackend
Source§fn store(
&self,
id: &str,
data: &[u8],
metadata: &FileMetadata,
) -> Result<FileInfo, String>
fn store( &self, id: &str, data: &[u8], metadata: &FileMetadata, ) -> Result<FileInfo, String>
Store data under the given ID with associated metadata.
Source§fn retrieve(&self, id: &str) -> Result<Vec<u8>, String>
fn retrieve(&self, id: &str) -> Result<Vec<u8>, String>
Retrieve the raw bytes for a stored file.
Source§fn delete(&self, id: &str) -> Result<bool, String>
fn delete(&self, id: &str) -> Result<bool, String>
Delete a stored file. Returns
true if the file existed and was removed.Auto Trait Implementations§
impl !Freeze for LocalBackend
impl RefUnwindSafe for LocalBackend
impl Send for LocalBackend
impl Sync for LocalBackend
impl Unpin for LocalBackend
impl UnsafeUnpin for LocalBackend
impl UnwindSafe for LocalBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more