[][src]Struct termscp::host::Localhost

pub struct Localhost { /* fields omitted */ }

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]

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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