pub struct LocalStorage { /* private fields */ }Expand description
Filesystem-backed storage rooted at a configured directory.
Implementations§
Source§impl LocalStorage
impl LocalStorage
Sourcepub fn from_options(options: LocalStorageOptions) -> Self
pub fn from_options(options: LocalStorageOptions) -> Self
Create local storage from explicit options.
Trait Implementations§
Source§impl Clone for LocalStorage
impl Clone for LocalStorage
Source§fn clone(&self) -> LocalStorage
fn clone(&self) -> LocalStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LocalStorage
impl Debug for LocalStorage
Source§impl Storage for LocalStorage
impl Storage for LocalStorage
Source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
content: &'life2 [u8],
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
content: &'life2 [u8],
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store content at a storage-relative key. Implementations must not overwrite.
Source§fn put_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
source: &'life2 Path,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
source: &'life2 Path,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a local file at a storage-relative key. Implementations must not overwrite.
Source§fn promote<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
temporary_key: &'life1 StorageKey,
durable_key: &'life2 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn promote<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
temporary_key: &'life1 StorageKey,
durable_key: &'life2 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Promote a temporary object to a durable storage-relative key without overwriting.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read content from a storage-relative key with an object-size cap.
Source§fn get_to_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
destination: &'life2 Path,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_to_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
destination: &'life2 Path,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Download an object into a local file with an object-size cap.
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return whether a storage-relative key exists.
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a storage-relative key if it exists.
Source§fn list_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<Vec<StorageKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<Vec<StorageKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List object keys below a storage-relative prefix.
Source§fn delete_prefix_older_than<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
older_than: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_prefix_older_than<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
older_than: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete every object below a storage-relative prefix older than the cutoff.
Source§fn delete_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete every object below a storage-relative prefix.
Auto Trait Implementations§
impl Freeze for LocalStorage
impl RefUnwindSafe for LocalStorage
impl Send for LocalStorage
impl Sync for LocalStorage
impl Unpin for LocalStorage
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.