Trait distant_core::SessionExt[][src]

pub trait SessionExt {
Show 14 methods fn append_file(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>,
        data: impl Into<Vec<u8>>
    ) -> Pin<Box<dyn Future<Output = Result<(), SessionExtError>> + Send + '_>>;
fn append_file_text(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>,
        data: impl Into<String>
    ) -> Pin<Box<dyn Future<Output = Result<(), SessionExtError>> + Send + '_>>;
fn copy(
        &mut self,
        tenant: impl Into<String>,
        src: impl Into<PathBuf>,
        dst: impl Into<PathBuf>
    ) -> Pin<Box<dyn Future<Output = Result<(), SessionExtError>> + Send + '_>>;
fn create_dir(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>,
        all: bool
    ) -> Pin<Box<dyn Future<Output = Result<(), SessionExtError>> + Send + '_>>;
fn exists(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>
    ) -> Pin<Box<dyn Future<Output = Result<bool, SessionExtError>> + Send + '_>>;
fn metadata(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>,
        canonicalize: bool,
        resolve_file_type: bool
    ) -> Pin<Box<dyn Future<Output = Result<Metadata, SessionExtError>> + Send + '_>>;
fn read_dir(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>,
        depth: usize,
        absolute: bool,
        canonicalize: bool,
        include_root: bool
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<DirEntry>, Vec<Failure>), SessionExtError>> + Send + '_>>;
fn read_file(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SessionExtError>> + Send + '_>>;
fn read_file_text(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>
    ) -> Pin<Box<dyn Future<Output = Result<String, SessionExtError>> + Send + '_>>;
fn remove(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>,
        force: bool
    ) -> Pin<Box<dyn Future<Output = Result<(), SessionExtError>> + Send + '_>>;
fn rename(
        &mut self,
        tenant: impl Into<String>,
        src: impl Into<PathBuf>,
        dst: impl Into<PathBuf>
    ) -> Pin<Box<dyn Future<Output = Result<(), SessionExtError>> + Send + '_>>;
fn spawn(
        &mut self,
        tenant: impl Into<String>,
        cmd: impl Into<String>,
        args: Vec<String>
    ) -> Pin<Box<dyn Future<Output = Result<RemoteProcess, RemoteProcessError>> + Send + '_>>;
fn write_file(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>,
        data: impl Into<Vec<u8>>
    ) -> Pin<Box<dyn Future<Output = Result<(), SessionExtError>> + Send + '_>>;
fn write_file_text(
        &mut self,
        tenant: impl Into<String>,
        path: impl Into<PathBuf>,
        data: impl Into<String>
    ) -> Pin<Box<dyn Future<Output = Result<(), SessionExtError>> + Send + '_>>;
}
Expand description

Provides convenience functions on top of a Session

Required methods

Appends to a remote file using the data from a collection of bytes

Appends to a remote file using the data from a string

Copies a remote file or directory from src to dst

Creates a remote directory, optionally creating all parent components if specified

Checks if a path exists on a remote machine

Retrieves metadata about a path on a remote machine

Reads entries from a directory, returning a tuple of directory entries and failures

Reads a remote file as a collection of bytes

Returns a remote file as a string

Removes a remote file or directory, supporting removal of non-empty directories if force is true

Renames a remote file or directory from src to dst

Spawns a process on the remote machine

Writes a remote file with the data from a collection of bytes

Writes a remote file with the data from a string

Implementors