pub struct FsStorage { /* private fields */ }Expand description
A StorageBackend rooted at a local directory.
Paths passed to the backend are treated as relative to root; any path
escaping the root (absolute, .., symlink-traversing) is rejected.
Implementations§
Trait Implementations§
Source§impl StorageBackend for FsStorage
impl StorageBackend for FsStorage
Source§fn file_meta<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<FileMeta>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn file_meta<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<FileMeta>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return metadata for
path, or None when it does not exist.Source§fn read_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
range: RangeSpec,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Read + Send>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
range: RangeSpec,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Read + Send>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn write_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
mode: WriteMode,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn UploadSink>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
mode: WriteMode,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn UploadSink>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Open a write stream for
path according to mode.Source§fn write_stream_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
session: &'life2 str,
mode: WriteMode,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn UploadSink>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_stream_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
session: &'life2 str,
mode: WriteMode,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn UploadSink>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Open a positional write stream for a concurrent “session” upload. Read more
Source§fn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<DirEntry>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<DirEntry>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List the children of directory
path (or the mount root when
path is empty).Source§fn mkdir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mkdir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Recursively create
path (and parents) as a directory.Auto Trait Implementations§
impl Freeze for FsStorage
impl RefUnwindSafe for FsStorage
impl Send for FsStorage
impl Sync for FsStorage
impl Unpin for FsStorage
impl UnsafeUnpin for FsStorage
impl UnwindSafe for FsStorage
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