Trait dav_server::fs::DavFileSystem
source · [−]pub trait DavFileSystem: Sync + Send + BoxCloneFs {
Show 14 methods
fn open<'a>(
&'a self,
path: &'a DavPath,
options: OpenOptions
) -> FsFuture<'_, Box<dyn DavFile>>;
fn read_dir<'a>(
&'a self,
path: &'a DavPath,
meta: ReadDirMeta
) -> FsFuture<'_, FsStream<Box<dyn DavDirEntry>>>;
fn metadata<'a>(
&'a self,
path: &'a DavPath
) -> FsFuture<'_, Box<dyn DavMetaData>>;
fn symlink_metadata<'a>(
&'a self,
path: &'a DavPath
) -> FsFuture<'_, Box<dyn DavMetaData>> { ... }
fn create_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'_, ()> { ... }
fn remove_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'_, ()> { ... }
fn remove_file<'a>(&'a self, path: &'a DavPath) -> FsFuture<'_, ()> { ... }
fn rename<'a>(
&'a self,
from: &'a DavPath,
to: &'a DavPath
) -> FsFuture<'_, ()> { ... }
fn copy<'a>(
&'a self,
from: &'a DavPath,
to: &'a DavPath
) -> FsFuture<'_, ()> { ... }
fn have_props<'a>(
&'a self,
path: &'a DavPath
) -> Pin<Box<dyn Future<Output = bool> + Send + 'a>> { ... }
fn patch_props<'a>(
&'a self,
path: &'a DavPath,
patch: Vec<(bool, DavProp)>
) -> FsFuture<'_, Vec<(StatusCode, DavProp)>> { ... }
fn get_props<'a>(
&'a self,
path: &'a DavPath,
do_content: bool
) -> FsFuture<'_, Vec<DavProp>> { ... }
fn get_prop<'a>(
&'a self,
path: &'a DavPath,
prop: DavProp
) -> FsFuture<'_, Vec<u8>> { ... }
fn get_quota(&self) -> FsFuture<'_, (u64, Option<u64>)> { ... }
}Expand description
The trait that defines a filesystem.
Required Methods
Open a file.
fn read_dir<'a>(
&'a self,
path: &'a DavPath,
meta: ReadDirMeta
) -> FsFuture<'_, FsStream<Box<dyn DavDirEntry>>>
fn read_dir<'a>(
&'a self,
path: &'a DavPath,
meta: ReadDirMeta
) -> FsFuture<'_, FsStream<Box<dyn DavDirEntry>>>
Perform read_dir.
Provided Methods
fn symlink_metadata<'a>(
&'a self,
path: &'a DavPath
) -> FsFuture<'_, Box<dyn DavMetaData>>
fn symlink_metadata<'a>(
&'a self,
path: &'a DavPath
) -> FsFuture<'_, Box<dyn DavMetaData>>
Return the metadata of a file, directory or symbolic link.
Differs from metadata() that if the path is a symbolic link, it return the metadata for the link itself, not for the thing it points to.
The default implementation returns FsError::NotImplemented.
fn create_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'_, ()>
fn create_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'_, ()>
Create a directory.
The default implementation returns FsError::NotImplemented.
fn remove_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'_, ()>
fn remove_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'_, ()>
Remove a directory.
The default implementation returns FsError::NotImplemented.
fn remove_file<'a>(&'a self, path: &'a DavPath) -> FsFuture<'_, ()>
fn remove_file<'a>(&'a self, path: &'a DavPath) -> FsFuture<'_, ()>
Remove a file.
The default implementation returns FsError::NotImplemented.
Rename a file or directory.
Source and destination must be the same type (file/dir). If the destination already exists and is a file, it should be replaced. If it is a directory it should give an error.
The default implementation returns FsError::NotImplemented.
Copy a file
Should also copy the DAV properties, if properties are implemented.
The default implementation returns FsError::NotImplemented.
Indicator that tells if this filesystem driver supports DAV properties.
The default implementation returns false.
fn patch_props<'a>(
&'a self,
path: &'a DavPath,
patch: Vec<(bool, DavProp)>
) -> FsFuture<'_, Vec<(StatusCode, DavProp)>>
fn patch_props<'a>(
&'a self,
path: &'a DavPath,
patch: Vec<(bool, DavProp)>
) -> FsFuture<'_, Vec<(StatusCode, DavProp)>>
Patch the DAV properties of a node (add/remove props)
The default implementation returns FsError::NotImplemented.
List/get the DAV properties of a node.
The default implementation returns FsError::NotImplemented.
Get one specific named property of a node.
The default implementation returns FsError::NotImplemented.
Trait Implementations
sourceimpl Clone for Box<dyn DavFileSystem>
impl Clone for Box<dyn DavFileSystem>
sourcefn clone(&self) -> Box<dyn DavFileSystem>
fn clone(&self) -> Box<dyn DavFileSystem>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Implementors
impl DavFileSystem for LocalFs
localfs only.impl DavFileSystem for MemFs
memfs only.