[−][src]Struct termscp::host::Localhost
Localhost
Localhost is the entity which holds the information about the current directory and host. It provides functions to navigate across the local host file system
Implementations
impl Localhost
[src]
pub fn new(wrkdir: PathBuf) -> Result<Localhost, HostError>
[src]
new
Instantiates a new Localhost struct
pub fn pwd(&self) -> PathBuf
[src]
pwd
Print working directory
pub fn list_dir(&self) -> Vec<FsEntry>
[src]
list_dir
List files in current directory
pub fn change_wrkdir(&mut self, new_dir: &Path) -> Result<PathBuf, HostError>
[src]
change_wrkdir
Change working directory with the new provided directory
pub fn mkdir(&mut self, dir_name: &Path) -> Result<(), HostError>
[src]
mkdir
Make a directory at path and update the file list (only if relative)
pub fn mkdir_ex(
&mut self,
dir_name: &Path,
ignex: bool
) -> Result<(), HostError>
[src]
&mut self,
dir_name: &Path,
ignex: bool
) -> Result<(), HostError>
mkdir_ex
Extended option version of makedir. ignex: don't report error if directory already exists
pub fn remove(&mut self, entry: &FsEntry) -> Result<(), HostError>
[src]
remove
Remove file entry
pub fn rename(
&mut self,
entry: &FsEntry,
dst_path: &Path
) -> Result<(), HostError>
[src]
&mut self,
entry: &FsEntry,
dst_path: &Path
) -> Result<(), HostError>
rename
Rename file or directory to new name
pub fn copy(&mut self, entry: &FsEntry, dst: &Path) -> Result<(), HostError>
[src]
copy
Copy file to destination path
pub fn stat(&self, path: &Path) -> Result<FsEntry, HostError>
[src]
stat
Stat file and create a FsEntry
pub fn chmod(&self, path: &Path, pex: (u8, u8, u8)) -> Result<(), HostError>
[src]
chmod
Change file mode to file, according to UNIX permissions
pub fn open_file_read(&self, file: &Path) -> Result<File, HostError>
[src]
open_file_read
Open file for read
pub fn open_file_write(&self, file: &Path) -> Result<File, HostError>
[src]
open_file_write
Open file for write
pub fn file_exists(&self, path: &Path) -> bool
[src]
file_exists
Returns whether provided file path exists
pub fn scan_dir(&self, dir: &Path) -> Result<Vec<FsEntry>, HostError>
[src]
scan_dir
Get content of the current directory as a list of fs entry (Windows)
Auto Trait Implementations
impl RefUnwindSafe for Localhost
[src]
impl Send for Localhost
[src]
impl Sync for Localhost
[src]
impl Unpin for Localhost
[src]
impl UnwindSafe for Localhost
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,