pub enum FileSystem {
Local {
path: String,
},
Remote {
path: String,
connection: Connection,
},
}Variants§
Implementations§
Source§impl FileSystem
impl FileSystem
pub fn new_local(path: &str) -> Result<Self, Box<dyn Error>>
pub fn new_remote( path: &str, connection_str: &str, password: Option<&str>, ) -> Result<Self, Box<dyn Error>>
pub fn separator(&self) -> char
pub fn pwd(&self) -> &str
pub fn cd(&mut self, path: &str)
pub fn ls(&self, path: &str) -> Result<Vec<String>, Box<dyn Error>>
pub fn read(&self, path: &str) -> Result<Vec<u8>, Box<dyn Error>>
pub fn mkdirs(&self, path: &str) -> Result<(), Box<dyn Error>>
pub fn create(&self, path: &str) -> Result<(), Box<dyn Error>>
pub fn write(&self, path: &str, data: &[u8]) -> Result<(), Box<dyn Error>>
pub fn is_file(&self, path: &str) -> bool
pub fn is_dir(&self, path: &str) -> bool
pub fn canonicalize(&self, path: &str) -> Result<String, Box<dyn Error>>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FileSystem
impl !RefUnwindSafe for FileSystem
impl Send for FileSystem
impl Sync for FileSystem
impl Unpin for FileSystem
impl !UnwindSafe for FileSystem
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
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>
Converts
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>
Converts
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