pub struct LocalStorage { /* private fields */ }Expand description
Local filesystem storage backend.
Files are written under base_dir/<prefix>/<ulid>.<ext>. Path traversal
is rejected at the storage layer — .. components and absolute paths
return an error before any filesystem operation is attempted.
Requires the local feature (enabled by default).
Implementations§
Trait Implementations§
Source§impl FileStorage for LocalStorage
impl FileStorage for LocalStorage
Source§fn store<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
file: &'life2 UploadedFile,
) -> Pin<Box<dyn Future<Output = Result<StoredFile, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn store<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
file: &'life2 UploadedFile,
) -> Pin<Box<dyn Future<Output = Result<StoredFile, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a buffered in-memory file under
prefix/. Read moreSource§fn store_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
stream: &'life2 mut BufferedUpload,
) -> Pin<Box<dyn Future<Output = Result<StoredFile, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn store_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
stream: &'life2 mut BufferedUpload,
) -> Pin<Box<dyn Future<Output = Result<StoredFile, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a chunked upload under
prefix/. Read moreAuto 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