pub struct OpendalContainer {
pub index: usize,
pub content: Vec<Entry>,
pub metadata_repr: Option<(usize, String)>,
/* private fields */
}Expand description
Holds any relevant content of an opendal container. It has an operator, allowing action on the remote files and knows about the root path and current content.
Fields§
§index: usizeCurrent index
content: Vec<Entry>Retrieved files
metadata_repr: Option<(usize, String)>Last retrieved information We keep a pair: index and string. It may be cached in the future
Implementations§
Source§impl OpendalContainer
impl OpendalContainer
Sourcepub fn update_metadata(&mut self) -> Result<()>
pub fn update_metadata(&mut self) -> Result<()>
Update the metadata with for the currently selected file
Sourcepub fn is_set(&self) -> bool
pub fn is_set(&self) -> bool
True if the opendal container is really set. IE if it’s connected to a remote container.
Sourcepub fn upload(&self, local_file: &FileInfo) -> Result<()>
pub fn upload(&self, local_file: &FileInfo) -> Result<()>
Upload the local file to the remote container in its current path.
Sourcepub fn download(&self, dest: &Path) -> Result<()>
pub fn download(&self, dest: &Path) -> Result<()>
Download the currently selected remote file to dest. The filename is preserved. Nothing is done if a local file with same filename already exists in current path.
This will most likely change in the future since it’s not the default behavior of most modern file managers.
Sourcepub fn create_newdir(&mut self, dirname: String) -> Result<()>
pub fn create_newdir(&mut self, dirname: String) -> Result<()>
Creates a new remote directory with dirname in current path.
Sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
Disconnect itself, reseting it’s parameters.
Sourcepub fn delete(&mut self) -> Result<()>
pub fn delete(&mut self) -> Result<()>
Delete the currently selected remote file Nothing is done if current path is empty.
Sourcepub fn enter_selected(&mut self) -> Result<()>
pub fn enter_selected(&mut self) -> Result<()>
Enter in the selected file or directory.
§Errors:
Will fail if the selected file is not a directory of the current path is empty.
Sourcepub fn refresh_current(&mut self) -> Result<()>
pub fn refresh_current(&mut self) -> Result<()>
Refresh the current remote path. Nothing is done if no connexion is established.
Sourcepub fn move_to_parent(&mut self) -> Result<()>
pub fn move_to_parent(&mut self) -> Result<()>
Move to remote parent directory if possible
Trait Implementations§
Source§impl Content<Entry> for OpendalContainer
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<Entry> for OpendalContainer
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
Source§impl Default for OpendalContainer
impl Default for OpendalContainer
Source§fn default() -> OpendalContainer
fn default() -> OpendalContainer
Source§impl DrawMenu<Entry> for OpendalContainer
impl DrawMenu<Entry> for OpendalContainer
Source§impl Selectable for OpendalContainer
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Selectable for OpendalContainer
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
Auto Trait Implementations§
impl Freeze for OpendalContainer
impl !RefUnwindSafe for OpendalContainer
impl Send for OpendalContainer
impl Sync for OpendalContainer
impl Unpin for OpendalContainer
impl !UnwindSafe for OpendalContainer
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more