Struct wildland_dfs::default::DefaultDfs
source · pub struct DefaultDfs { /* private fields */ }
Implementations§
source§impl DefaultDfs
impl DefaultDfs
pub fn new( path_resolver: Box<dyn PathResolver>, storage_backend_factories: HashMap<UniCase<String>, Box<dyn StorageBackendFactory>>, runtime: Arc<Runtime> ) -> Self
Trait Implementations§
source§impl DfsFrontend for DefaultDfs
impl DfsFrontend for DefaultDfs
source§fn read_dir(
&self,
requested_path: String
) -> Result<Vec<DirEntry>, DfsFrontendError>
fn read_dir( &self, requested_path: String ) -> Result<Vec<DirEntry>, DfsFrontendError>
Returns nodes descriptors found in the given path taking into account all of the user’s containers.
NOTE: Conflicting paths
More than one container may have nodes claiming the same “full path” - meaning
concatenation of a path claimed by a container with a path of the file inside the container.
It is possible that returned nodes include both such files.
Example:
Container C1 claims path /a
and includes file /b/c
.
Container C2 claims path /a/b/
and includes file /c
.
In this case, result includes the following descriptors:
[
NodeDescriptor { path: “/b/c”, storage:
source§fn get_path(&self, identifier: String) -> Result<String, DfsFrontendError>
fn get_path(&self, identifier: String) -> Result<String, DfsFrontendError>
Returns path for the provided Wildland Id
source§fn metadata(
&self,
input_exposed_path: String
) -> Result<NodeStat, DfsFrontendError>
fn metadata( &self, input_exposed_path: String ) -> Result<NodeStat, DfsFrontendError>
Returns metadata of a node. Read more
source§fn remove_file(
&self,
input_exposed_path: String
) -> Result<(), DfsFrontendError>
fn remove_file( &self, input_exposed_path: String ) -> Result<(), DfsFrontendError>
Removes a file Read more
source§fn create_dir(&self, requested_path: String) -> Result<(), DfsFrontendError>
fn create_dir(&self, requested_path: String) -> Result<(), DfsFrontendError>
Creates a new, empty directory at the provided path Read more
source§fn remove_dir(
&self,
requested_path: String,
is_recursive: bool
) -> Result<(), DfsFrontendError>
fn remove_dir( &self, requested_path: String, is_recursive: bool ) -> Result<(), DfsFrontendError>
Removes a directory
If
is_recursive
is set to true, it will remove all the children of the directory Read moresource§fn rename(
&self,
old_path: String,
new_path: String
) -> Result<(), DfsFrontendError>
fn rename( &self, old_path: String, new_path: String ) -> Result<(), DfsFrontendError>
Rename a file or directory to a new path, if new path does not exist yet.
In contrast to POSIX-like rename operation, it returns error in case of new path existence
in all cases, so it is up to a caller whether to remove a node under new path or not. Read more
source§fn set_permissions(
&self,
input_exposed_path: String,
permissions: WlPermissions
) -> Result<(), DfsFrontendError>
fn set_permissions( &self, input_exposed_path: String, permissions: WlPermissions ) -> Result<(), DfsFrontendError>
Changes the permissions of the underlying file.
source§fn set_owner(&self, _path: String) -> Result<(), DfsFrontendError>
fn set_owner(&self, _path: String) -> Result<(), DfsFrontendError>
Not supported yet - it always returns
DfsFrontendError::Generic(_)
source§fn stat_fs(
&self,
input_exposed_path: String
) -> Result<FsStat, DfsFrontendError>
fn stat_fs( &self, input_exposed_path: String ) -> Result<FsStat, DfsFrontendError>
Returns information about a mounted filesystem. Path is the pathname of any file within the
mounted filesystem. Read more
source§fn get_receiver(&self) -> Arc<Mutex<dyn EventReceiver>>
fn get_receiver(&self) -> Arc<Mutex<dyn EventReceiver>>
Returns receiver that can listen to DFS events.
Events may be split between different
EventReceiver
.source§fn mount(&self, storage: &Storage) -> Result<(), DfsFrontendError>
fn mount(&self, storage: &Storage) -> Result<(), DfsFrontendError>
Attempts to mount given Storage. This method’s state
should not be considered emphemeral. Read more
source§fn get_space_usage(
&self,
storage: &Storage
) -> Result<SpaceUsage, DfsFrontendError>
fn get_space_usage( &self, storage: &Storage ) -> Result<SpaceUsage, DfsFrontendError>
Returns (used, total) space in bytes
source§fn is_accessible(&self, storage: &Storage) -> Result<bool, DfsFrontendError>
fn is_accessible(&self, storage: &Storage) -> Result<bool, DfsFrontendError>
Checks whether the Storage is accessible
source§fn download(
&self,
path: String,
output: Box<dyn OStream>,
progress_reporter: Box<dyn ProgressReporter>,
abort_flag: &AbortFlag
) -> Result<(), DfsFrontendError>
fn download( &self, path: String, output: Box<dyn OStream>, progress_reporter: Box<dyn ProgressReporter>, abort_flag: &AbortFlag ) -> Result<(), DfsFrontendError>
Downloads a file and writes it to the provided output stream
source§fn upload(
&self,
path: String,
input: Box<dyn IStream>,
progress_reporter: Box<dyn ProgressReporter>,
abort_flag: &AbortFlag,
creation_time: Option<UnixTimestamp>
) -> Result<(), DfsFrontendError>
fn upload( &self, path: String, input: Box<dyn IStream>, progress_reporter: Box<dyn ProgressReporter>, abort_flag: &AbortFlag, creation_time: Option<UnixTimestamp> ) -> Result<(), DfsFrontendError>
Reads a file from the provided input stream and uploads it to the backend
Auto Trait Implementations§
impl !RefUnwindSafe for DefaultDfs
impl Send for DefaultDfs
impl Sync for DefaultDfs
impl Unpin for DefaultDfs
impl !UnwindSafe for DefaultDfs
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