Trait distant_core::DistantChannelExt
source · [−]pub trait DistantChannelExt {
Show 22 methods
fn append_file(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<Vec<u8>>
) -> AsyncReturn<'_, ()>;
fn append_file_text(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<String>
) -> AsyncReturn<'_, ()>;
fn capabilities(&mut self) -> AsyncReturn<'_, Capabilities>;
fn copy(
&mut self,
src: impl Into<PathBuf>,
dst: impl Into<PathBuf>
) -> AsyncReturn<'_, ()>;
fn create_dir(
&mut self,
path: impl Into<PathBuf>,
all: bool
) -> AsyncReturn<'_, ()>;
fn exists(&mut self, path: impl Into<PathBuf>) -> AsyncReturn<'_, bool>;
fn metadata(
&mut self,
path: impl Into<PathBuf>,
canonicalize: bool,
resolve_file_type: bool
) -> AsyncReturn<'_, Metadata>;
fn search(
&mut self,
query: impl Into<SearchQuery>
) -> AsyncReturn<'_, Searcher>;
fn cancel_search(&mut self, id: SearchId) -> AsyncReturn<'_, ()>;
fn read_dir(
&mut self,
path: impl Into<PathBuf>,
depth: usize,
absolute: bool,
canonicalize: bool,
include_root: bool
) -> AsyncReturn<'_, (Vec<DirEntry>, Vec<Failure>)>;
fn read_file(&mut self, path: impl Into<PathBuf>) -> AsyncReturn<'_, Vec<u8>>;
fn read_file_text(
&mut self,
path: impl Into<PathBuf>
) -> AsyncReturn<'_, String>;
fn remove(
&mut self,
path: impl Into<PathBuf>,
force: bool
) -> AsyncReturn<'_, ()>;
fn rename(
&mut self,
src: impl Into<PathBuf>,
dst: impl Into<PathBuf>
) -> AsyncReturn<'_, ()>;
fn watch(
&mut self,
path: impl Into<PathBuf>,
recursive: bool,
only: impl Into<ChangeKindSet>,
except: impl Into<ChangeKindSet>
) -> AsyncReturn<'_, Watcher>;
fn unwatch(&mut self, path: impl Into<PathBuf>) -> AsyncReturn<'_, ()>;
fn spawn(
&mut self,
cmd: impl Into<String>,
environment: Environment,
current_dir: Option<PathBuf>,
persist: bool,
pty: Option<PtySize>
) -> AsyncReturn<'_, RemoteProcess>;
fn spawn_lsp(
&mut self,
cmd: impl Into<String>,
environment: Environment,
current_dir: Option<PathBuf>,
persist: bool,
pty: Option<PtySize>
) -> AsyncReturn<'_, RemoteLspProcess>;
fn output(
&mut self,
cmd: impl Into<String>,
environment: Environment,
current_dir: Option<PathBuf>,
pty: Option<PtySize>
) -> AsyncReturn<'_, RemoteOutput>;
fn system_info(&mut self) -> AsyncReturn<'_, SystemInfo>;
fn write_file(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<Vec<u8>>
) -> AsyncReturn<'_, ()>;
fn write_file_text(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<String>
) -> AsyncReturn<'_, ()>;
}
Expand description
Provides convenience functions on top of a Channel
Required Methods
sourcefn append_file(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<Vec<u8>>
) -> AsyncReturn<'_, ()>
fn append_file(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<Vec<u8>>
) -> AsyncReturn<'_, ()>
Appends to a remote file using the data from a collection of bytes
sourcefn append_file_text(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<String>
) -> AsyncReturn<'_, ()>
fn append_file_text(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<String>
) -> AsyncReturn<'_, ()>
Appends to a remote file using the data from a string
sourcefn capabilities(&mut self) -> AsyncReturn<'_, Capabilities>
fn capabilities(&mut self) -> AsyncReturn<'_, Capabilities>
Retrieves server capabilities
Copies a remote file or directory from src to dst
sourcefn create_dir(
&mut self,
path: impl Into<PathBuf>,
all: bool
) -> AsyncReturn<'_, ()>
fn create_dir(
&mut self,
path: impl Into<PathBuf>,
all: bool
) -> AsyncReturn<'_, ()>
Creates a remote directory, optionally creating all parent components if specified
Retrieves metadata about a path on a remote machine
sourcefn search(&mut self, query: impl Into<SearchQuery>) -> AsyncReturn<'_, Searcher>
fn search(&mut self, query: impl Into<SearchQuery>) -> AsyncReturn<'_, Searcher>
Perform a search
sourcefn cancel_search(&mut self, id: SearchId) -> AsyncReturn<'_, ()>
fn cancel_search(&mut self, id: SearchId) -> AsyncReturn<'_, ()>
Cancel an active search query
Reads entries from a directory, returning a tuple of directory entries and failures
Reads a remote file as a collection of bytes
sourcefn read_file_text(&mut self, path: impl Into<PathBuf>) -> AsyncReturn<'_, String>
fn read_file_text(&mut self, path: impl Into<PathBuf>) -> AsyncReturn<'_, String>
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
sourcefn watch(
&mut self,
path: impl Into<PathBuf>,
recursive: bool,
only: impl Into<ChangeKindSet>,
except: impl Into<ChangeKindSet>
) -> AsyncReturn<'_, Watcher>
fn watch(
&mut self,
path: impl Into<PathBuf>,
recursive: bool,
only: impl Into<ChangeKindSet>,
except: impl Into<ChangeKindSet>
) -> AsyncReturn<'_, Watcher>
Watches a remote file or directory
Unwatches a remote file or directory
sourcefn spawn(
&mut self,
cmd: impl Into<String>,
environment: Environment,
current_dir: Option<PathBuf>,
persist: bool,
pty: Option<PtySize>
) -> AsyncReturn<'_, RemoteProcess>
fn spawn(
&mut self,
cmd: impl Into<String>,
environment: Environment,
current_dir: Option<PathBuf>,
persist: bool,
pty: Option<PtySize>
) -> AsyncReturn<'_, RemoteProcess>
Spawns a process on the remote machine
sourcefn spawn_lsp(
&mut self,
cmd: impl Into<String>,
environment: Environment,
current_dir: Option<PathBuf>,
persist: bool,
pty: Option<PtySize>
) -> AsyncReturn<'_, RemoteLspProcess>
fn spawn_lsp(
&mut self,
cmd: impl Into<String>,
environment: Environment,
current_dir: Option<PathBuf>,
persist: bool,
pty: Option<PtySize>
) -> AsyncReturn<'_, RemoteLspProcess>
Spawns an LSP process on the remote machine
sourcefn output(
&mut self,
cmd: impl Into<String>,
environment: Environment,
current_dir: Option<PathBuf>,
pty: Option<PtySize>
) -> AsyncReturn<'_, RemoteOutput>
fn output(
&mut self,
cmd: impl Into<String>,
environment: Environment,
current_dir: Option<PathBuf>,
pty: Option<PtySize>
) -> AsyncReturn<'_, RemoteOutput>
Spawns a process on the remote machine and wait for it to complete
sourcefn system_info(&mut self) -> AsyncReturn<'_, SystemInfo>
fn system_info(&mut self) -> AsyncReturn<'_, SystemInfo>
Retrieves information about the remote system
sourcefn write_file(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<Vec<u8>>
) -> AsyncReturn<'_, ()>
fn write_file(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<Vec<u8>>
) -> AsyncReturn<'_, ()>
Writes a remote file with the data from a collection of bytes
sourcefn write_file_text(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<String>
) -> AsyncReturn<'_, ()>
fn write_file_text(
&mut self,
path: impl Into<PathBuf>,
data: impl Into<String>
) -> AsyncReturn<'_, ()>
Writes a remote file with the data from a string