pub struct LocalStorage { /* private fields */ }Expand description
Local filesystem storage implementation Stores shards and metadata on local filesystem with CID-based addressing
Implementations§
Trait Implementations§
Source§impl StorageBackend for LocalStorage
impl StorageBackend for LocalStorage
Source§fn put_shard<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
shard: &'life2 Shard,
) -> Pin<Box<dyn Future<Output = Result<(), FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_shard<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
shard: &'life2 Shard,
) -> Pin<Box<dyn Future<Output = Result<(), FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a shard with the given CID
Source§fn get_shard<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<Shard, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_shard<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<Shard, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a shard by CID
Source§fn delete_shard<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<(), FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_shard<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<(), FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a shard by CID
Source§fn has_shard<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<bool, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_shard<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<bool, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a shard exists
Source§fn list_shards<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Cid>, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_shards<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Cid>, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all shard CIDs in storage
Source§fn put_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
metadata: &'life1 FileMetadata,
) -> Pin<Box<dyn Future<Output = Result<(), FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
metadata: &'life1 FileMetadata,
) -> Pin<Box<dyn Future<Output = Result<(), FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store file metadata
Source§fn get_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
file_id: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<FileMetadata, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
file_id: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<FileMetadata, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve file metadata
Source§fn delete_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
file_id: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<(), FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
file_id: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<(), FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete file metadata
Source§fn list_metadata<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<FileMetadata>, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_metadata<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<FileMetadata>, FecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all file metadata
Auto Trait Implementations§
impl Freeze for LocalStorage
impl RefUnwindSafe for LocalStorage
impl Send for LocalStorage
impl Sync for LocalStorage
impl Unpin for LocalStorage
impl UnwindSafe for LocalStorage
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