pub struct DefaultDfs { /* private fields */ }

Implementations§

source§

impl DefaultDfs

source

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

source§

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: }, NodeDescriptor { path: “/c”, storage: }, ]

source§

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>

Returns metadata of a node. Read more
source§

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>

Creates a new, empty directory at the provided path Read more
source§

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 more
source§

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>

Changes the permissions of the underlying file.
source§

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>

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>>

Returns receiver that can listen to DFS events. Events may be split between different EventReceiver.
source§

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>

Returns (used, total) space in bytes
source§

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>

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>

Reads a file from the provided input stream and uploads it to the backend

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more