pub struct LocalStore { /* private fields */ }Expand description
Local filesystem storage backend with root-confined keys and write targets.
Implementations§
Source§impl LocalStore
impl LocalStore
Sourcepub fn new(config: LocalStoreConfig) -> AppResult<Self>
pub fn new(config: LocalStoreConfig) -> AppResult<Self>
Create a new local store.
Trait Implementations§
Source§impl FileStore for LocalStore
impl FileStore for LocalStore
Source§fn upload<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source: &'life1 FileSource,
key: &'life2 str,
options: UploadOptions,
) -> Pin<Box<dyn Future<Output = AppResult<StoredFile>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upload<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source: &'life1 FileSource,
key: &'life2 str,
options: UploadOptions,
) -> Pin<Box<dyn Future<Output = AppResult<StoredFile>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Upload a file to the store. Read more
Source§fn download<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = AppResult<FileSource>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn download<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = AppResult<FileSource>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Download a file from the store.
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a file from the store.
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = AppResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = AppResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a file exists in the store.
Source§fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = AppResult<StoredFile>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = AppResult<StoredFile>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get metadata about a stored file without downloading it.
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = AppResult<Vec<StoredFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = AppResult<Vec<StoredFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List files with a given prefix.
Source§fn presigned_url<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
_expires_in: Duration,
) -> Pin<Box<dyn Future<Output = AppResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn presigned_url<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
_expires_in: Duration,
) -> Pin<Box<dyn Future<Output = AppResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate a presigned URL for temporary access.
Source§fn copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from_key: &'life1 str,
to_key: &'life2 str,
) -> Pin<Box<dyn Future<Output = AppResult<StoredFile>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from_key: &'life1 str,
to_key: &'life2 str,
) -> Pin<Box<dyn Future<Output = AppResult<StoredFile>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Copy a file within the store.
Source§fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from_key: &'life1 str,
to_key: &'life2 str,
) -> Pin<Box<dyn Future<Output = AppResult<StoredFile>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from_key: &'life1 str,
to_key: &'life2 str,
) -> Pin<Box<dyn Future<Output = AppResult<StoredFile>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Rename (move) a file within the store.
Auto Trait Implementations§
impl Freeze for LocalStore
impl RefUnwindSafe for LocalStore
impl Send for LocalStore
impl Sync for LocalStore
impl Unpin for LocalStore
impl UnsafeUnpin for LocalStore
impl UnwindSafe for LocalStore
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