pub trait DistantApi {
Show 26 methods
// Provided methods
fn on_connect<'life0, 'async_trait>(
&'life0 self,
id: ConnectionId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn on_disconnect<'life0, 'async_trait>(
&'life0 self,
id: ConnectionId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn version<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
) -> Pin<Box<dyn Future<Output = Result<Version>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn read_file<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn read_file_text<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn write_file<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn write_file_text<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn append_file<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn append_file_text<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn read_dir<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
depth: usize,
absolute: bool,
canonicalize: bool,
include_root: bool,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DirEntry>, Vec<Error>)>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn create_dir<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
all: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn copy<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
src: PathBuf,
dst: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn remove<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
force: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn rename<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
src: PathBuf,
dst: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn watch<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
recursive: bool,
only: Vec<ChangeKind>,
except: Vec<ChangeKind>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn unwatch<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn exists<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn metadata<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
canonicalize: bool,
resolve_file_type: bool,
) -> Pin<Box<dyn Future<Output = Result<Metadata>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn set_permissions<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
permissions: Permissions,
options: SetPermissionsOptions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn search<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
query: SearchQuery,
) -> Pin<Box<dyn Future<Output = Result<SearchId>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn cancel_search<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: SearchId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn proc_spawn<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
cmd: String,
environment: Environment,
current_dir: Option<PathBuf>,
pty: Option<PtySize>,
) -> Pin<Box<dyn Future<Output = Result<ProcessId>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn proc_kill<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: ProcessId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn proc_stdin<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: ProcessId,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn proc_resize_pty<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: ProcessId,
size: PtySize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn system_info<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
) -> Pin<Box<dyn Future<Output = Result<SystemInfo>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Interface to support the suite of functionality available with distant, which can be used to build other servers that are compatible with distant
Provided Methods§
Sourcefn on_connect<'life0, 'async_trait>(
&'life0 self,
id: ConnectionId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn on_connect<'life0, 'async_trait>(
&'life0 self,
id: ConnectionId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Invoked whenever a new connection is established.
Sourcefn on_disconnect<'life0, 'async_trait>(
&'life0 self,
id: ConnectionId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn on_disconnect<'life0, 'async_trait>(
&'life0 self,
id: ConnectionId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Invoked whenever an existing connection is dropped.
Sourcefn version<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
) -> Pin<Box<dyn Future<Output = Result<Version>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn version<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
) -> Pin<Box<dyn Future<Output = Result<Version>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Retrieves information about the server’s capabilities.
Override this, otherwise it will return “unsupported” as an error.
Sourcefn read_file<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn read_file<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Reads bytes from a file.
path- the path to the file
Override this, otherwise it will return “unsupported” as an error.
Sourcefn read_file_text<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn read_file_text<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Reads bytes from a file as text.
path- the path to the file
Override this, otherwise it will return “unsupported” as an error.
Sourcefn write_file<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn write_file<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Writes bytes to a file, overwriting the file if it exists.
path- the path to the filedata- the data to write
Override this, otherwise it will return “unsupported” as an error.
Sourcefn write_file_text<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn write_file_text<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Writes text to a file, overwriting the file if it exists.
path- the path to the filedata- the data to write
Override this, otherwise it will return “unsupported” as an error.
Sourcefn append_file<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn append_file<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Writes bytes to the end of a file, creating it if it is missing.
path- the path to the filedata- the data to append
Override this, otherwise it will return “unsupported” as an error.
Sourcefn append_file_text<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn append_file_text<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
data: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Writes bytes to the end of a file, creating it if it is missing.
path- the path to the filedata- the data to append
Override this, otherwise it will return “unsupported” as an error.
Sourcefn read_dir<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
depth: usize,
absolute: bool,
canonicalize: bool,
include_root: bool,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DirEntry>, Vec<Error>)>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn read_dir<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
depth: usize,
absolute: bool,
canonicalize: bool,
include_root: bool,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DirEntry>, Vec<Error>)>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Reads entries from a directory.
path- the path to the directorydepth- how far to traverse the directory, 0 being unlimitedabsolute- if true, will return absolute paths instead of relative pathscanonicalize- if true, will canonicalize entry paths before returnedinclude_root- if true, will include the directory specified in the entries
Override this, otherwise it will return “unsupported” as an error.
Sourcefn create_dir<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
all: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn create_dir<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
all: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Creates a directory.
path- the path to the directoryall- if true, will create all missing parent components
Override this, otherwise it will return “unsupported” as an error.
Sourcefn copy<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
src: PathBuf,
dst: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn copy<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
src: PathBuf,
dst: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Copies some file or directory.
src- the path to the file or directory to copydst- the path where the copy will be placed
Override this, otherwise it will return “unsupported” as an error.
Sourcefn remove<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
force: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn remove<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
force: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Removes some file or directory.
path- the path to a file or directoryforce- if true, will remove non-empty directories
Override this, otherwise it will return “unsupported” as an error.
Sourcefn rename<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
src: PathBuf,
dst: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn rename<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
src: PathBuf,
dst: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Renames some file or directory.
src- the path to the file or directory to renamedst- the new name for the file or directory
Override this, otherwise it will return “unsupported” as an error.
Sourcefn watch<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
recursive: bool,
only: Vec<ChangeKind>,
except: Vec<ChangeKind>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn watch<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
recursive: bool,
only: Vec<ChangeKind>,
except: Vec<ChangeKind>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Watches a file or directory for changes.
path- the path to the file or directoryrecursive- if true, will watch for changes within subdirectories and beyondonly- if non-empty, will limit reported changes to those included in this listexcept- if non-empty, will limit reported changes to those not included in this list
Override this, otherwise it will return “unsupported” as an error.
Sourcefn unwatch<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn unwatch<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Removes a file or directory from being watched.
path- the path to the file or directory
Override this, otherwise it will return “unsupported” as an error.
Sourcefn exists<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn exists<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Checks if the specified path exists.
path- the path to the file or directory
Override this, otherwise it will return “unsupported” as an error.
Sourcefn metadata<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
canonicalize: bool,
resolve_file_type: bool,
) -> Pin<Box<dyn Future<Output = Result<Metadata>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn metadata<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
canonicalize: bool,
resolve_file_type: bool,
) -> Pin<Box<dyn Future<Output = Result<Metadata>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Reads metadata for a file or directory.
path- the path to the file or directorycanonicalize- if true, will include a canonicalized path in the metadataresolve_file_type- if true, will resolve symlinks to underlying type (file or dir)
Override this, otherwise it will return “unsupported” as an error.
Sourcefn set_permissions<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
permissions: Permissions,
options: SetPermissionsOptions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn set_permissions<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
path: PathBuf,
permissions: Permissions,
options: SetPermissionsOptions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Sets permissions for a file, directory, or symlink.
path- the path to the file, directory, or symlinkresolve_symlink- if true, will resolve the path to the underlying file/directorypermissions- the new permissions to apply
Override this, otherwise it will return “unsupported” as an error.
Sourcefn search<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
query: SearchQuery,
) -> Pin<Box<dyn Future<Output = Result<SearchId>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn search<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
query: SearchQuery,
) -> Pin<Box<dyn Future<Output = Result<SearchId>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Searches files for matches based on a query.
query- the specific query to perform
Override this, otherwise it will return “unsupported” as an error.
Sourcefn cancel_search<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: SearchId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn cancel_search<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: SearchId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Cancels an actively-ongoing search.
id- the id of the search to cancel
Override this, otherwise it will return “unsupported” as an error.
Sourcefn proc_spawn<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
cmd: String,
environment: Environment,
current_dir: Option<PathBuf>,
pty: Option<PtySize>,
) -> Pin<Box<dyn Future<Output = Result<ProcessId>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn proc_spawn<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
cmd: String,
environment: Environment,
current_dir: Option<PathBuf>,
pty: Option<PtySize>,
) -> Pin<Box<dyn Future<Output = Result<ProcessId>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Spawns a new process, returning its id.
cmd- the full command to run as a new process (including arguments)environment- the environment variables to associate with the processcurrent_dir- the alternative current directory to use with the processpty- if provided, will run the process within a PTY of the given size
Override this, otherwise it will return “unsupported” as an error.
Sourcefn proc_kill<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: ProcessId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn proc_kill<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: ProcessId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Kills a running process by its id.
id- the unique id of the process
Override this, otherwise it will return “unsupported” as an error.
Sourcefn proc_stdin<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: ProcessId,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn proc_stdin<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: ProcessId,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Sends data to the stdin of the process with the specified id.
id- the unique id of the processdata- the bytes to send to stdin
Override this, otherwise it will return “unsupported” as an error.
Sourcefn proc_resize_pty<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: ProcessId,
size: PtySize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn proc_resize_pty<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
id: ProcessId,
size: PtySize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Resizes the PTY of the process with the specified id.
id- the unique id of the processsize- the new size of the pty
Override this, otherwise it will return “unsupported” as an error.
Sourcefn system_info<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
) -> Pin<Box<dyn Future<Output = Result<SystemInfo>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn system_info<'life0, 'async_trait>(
&'life0 self,
ctx: DistantCtx,
) -> Pin<Box<dyn Future<Output = Result<SystemInfo>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Retrieves information about the system.
Override this, otherwise it will return “unsupported” as an error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".