pub struct ConnectedClient {
pub timeout: Duration,
/* private fields */
}Expand description
Represents a client after connecting to an endpoint
Fields§
§timeout: DurationRepresents maximum to wait on responses before timing out
Implementations§
Source§impl ConnectedClient
impl ConnectedClient
Sourcepub const DEFAULT_TIMEOUT: Duration
pub const DEFAULT_TIMEOUT: Duration
Default timeout applied to a new client for any ask made
pub fn remote_addr(&self) -> SocketAddr
pub async fn wait(self) -> Result<(), JoinError>
Sourcepub async fn ask(&mut self, request: Request) -> Result<Reply, AskError>
pub async fn ask(&mut self, request: Request) -> Result<Reply, AskError>
Generic ask of the server that is expecting a response
Sourcepub async fn tell(&mut self, request: Request) -> Result<(), SendError>
pub async fn tell(&mut self, request: Request) -> Result<(), SendError>
Sends a msg to the server, not expecting a response
Sourcepub async fn ask_heartbeat(&mut self) -> Result<(), AskError>
pub async fn ask_heartbeat(&mut self) -> Result<(), AskError>
Requests heartbeat from the server
Sourcepub async fn ask_version(&mut self) -> Result<VersionArgs, AskError>
pub async fn ask_version(&mut self) -> Result<VersionArgs, AskError>
Requests the version from the server
Sourcepub async fn ask_capabilities(&mut self) -> Result<CapabilitiesArgs, AskError>
pub async fn ask_capabilities(&mut self) -> Result<CapabilitiesArgs, AskError>
Requests the capabilities from the server
Sourcepub async fn ask_create_dir(
&mut self,
path: String,
include_components: bool,
) -> Result<DirCreatedArgs, FileAskError>
pub async fn ask_create_dir( &mut self, path: String, include_components: bool, ) -> Result<DirCreatedArgs, FileAskError>
Requests to create a new directory
Sourcepub async fn ask_rename_dir(
&mut self,
from: String,
to: String,
) -> Result<DirRenamedArgs, FileAskError>
pub async fn ask_rename_dir( &mut self, from: String, to: String, ) -> Result<DirRenamedArgs, FileAskError>
Requests to rename an existing directory
Sourcepub async fn ask_remove_dir(
&mut self,
path: String,
non_empty: bool,
) -> Result<DirRemovedArgs, FileAskError>
pub async fn ask_remove_dir( &mut self, path: String, non_empty: bool, ) -> Result<DirRemovedArgs, FileAskError>
Requests to remove an existing directory
Sourcepub async fn ask_list_root_dir_contents(
&mut self,
) -> Result<DirContentsListArgs, FileAskError>
pub async fn ask_list_root_dir_contents( &mut self, ) -> Result<DirContentsListArgs, FileAskError>
Requests to get a list of the root directory’s contents on the server
Sourcepub async fn ask_list_dir_contents(
&mut self,
path: String,
) -> Result<DirContentsListArgs, FileAskError>
pub async fn ask_list_dir_contents( &mut self, path: String, ) -> Result<DirContentsListArgs, FileAskError>
Requests to get a list of a directory’s contents on the server
Sourcepub async fn ask_open_file(
&mut self,
path: String,
) -> Result<FileOpenedArgs, FileAskError>
pub async fn ask_open_file( &mut self, path: String, ) -> Result<FileOpenedArgs, FileAskError>
Requests to open a file for reading/writing on the server, creating the file if it does not exist
Sourcepub async fn ask_open_file_with_options(
&mut self,
path: String,
create: bool,
write: bool,
read: bool,
) -> Result<FileOpenedArgs, FileAskError>
pub async fn ask_open_file_with_options( &mut self, path: String, create: bool, write: bool, read: bool, ) -> Result<FileOpenedArgs, FileAskError>
Requests to open a file on the server, opening using the provided options
Sourcepub async fn ask_close_file(
&mut self,
file: &RemoteFile,
) -> Result<FileClosedArgs, FileAskError>
pub async fn ask_close_file( &mut self, file: &RemoteFile, ) -> Result<FileClosedArgs, FileAskError>
Requests to close an open file
Sourcepub async fn ask_rename_file(
&mut self,
file: &mut RemoteFile,
to: String,
) -> Result<FileRenamedArgs, FileAskError>
pub async fn ask_rename_file( &mut self, file: &mut RemoteFile, to: String, ) -> Result<FileRenamedArgs, FileAskError>
Requests to rename an open file
Sourcepub async fn ask_rename_unopened_file(
&mut self,
from: String,
to: String,
) -> Result<UnopenedFileRenamedArgs, FileAskError>
pub async fn ask_rename_unopened_file( &mut self, from: String, to: String, ) -> Result<UnopenedFileRenamedArgs, FileAskError>
Requests to rename a non-open file
Sourcepub async fn ask_remove_file(
&mut self,
file: &mut RemoteFile,
) -> Result<FileRemovedArgs, FileAskError>
pub async fn ask_remove_file( &mut self, file: &mut RemoteFile, ) -> Result<FileRemovedArgs, FileAskError>
Requests to remove an open file
Sourcepub async fn ask_remove_unopened_file(
&mut self,
path: String,
) -> Result<UnopenedFileRemovedArgs, FileAskError>
pub async fn ask_remove_unopened_file( &mut self, path: String, ) -> Result<UnopenedFileRemovedArgs, FileAskError>
Requests to remove a non-open file
Sourcepub async fn ask_read_file(
&mut self,
file: &RemoteFile,
) -> Result<FileContentsArgs, FileAskError>
pub async fn ask_read_file( &mut self, file: &RemoteFile, ) -> Result<FileContentsArgs, FileAskError>
Requests the full contents of a file on the server
Sourcepub async fn ask_write_file(
&mut self,
file: &mut RemoteFile,
contents: &[u8],
) -> Result<FileWrittenArgs, FileAskError>
pub async fn ask_write_file( &mut self, file: &mut RemoteFile, contents: &[u8], ) -> Result<FileWrittenArgs, FileAskError>
Requests to write the contents of a file on the server
Sourcepub async fn ask_exec_proc(
&mut self,
command: String,
args: Vec<String>,
) -> Result<ProcStartedArgs, ExecAskError>
pub async fn ask_exec_proc( &mut self, command: String, args: Vec<String>, ) -> Result<ProcStartedArgs, ExecAskError>
Requests to execute a process on the server, providing support to send lines of text via stdin and reading back lines of text via stdout and stderr
Sourcepub async fn ask_exec_proc_with_current_dir(
&mut self,
command: String,
args: Vec<String>,
current_dir: String,
) -> Result<ProcStartedArgs, ExecAskError>
pub async fn ask_exec_proc_with_current_dir( &mut self, command: String, args: Vec<String>, current_dir: String, ) -> Result<ProcStartedArgs, ExecAskError>
Requests to execute a process on the server, providing support to send lines of text via stdin and reading back lines of text via stdout and stderr
Sourcepub async fn ask_exec_proc_with_options(
&mut self,
command: String,
args: Vec<String>,
stdin: bool,
stdout: bool,
stderr: bool,
current_dir: Option<String>,
) -> Result<ProcStartedArgs, ExecAskError>
pub async fn ask_exec_proc_with_options( &mut self, command: String, args: Vec<String>, stdin: bool, stdout: bool, stderr: bool, current_dir: Option<String>, ) -> Result<ProcStartedArgs, ExecAskError>
Requests to execute a process on the server, indicating whether to ignore or use stdin, stdout, and stderr
Sourcepub async fn ask_write_proc_stdin(
&mut self,
proc: &RemoteProc,
input: &[u8],
) -> Result<ProcStdinWrittenArgs, ExecAskError>
pub async fn ask_write_proc_stdin( &mut self, proc: &RemoteProc, input: &[u8], ) -> Result<ProcStdinWrittenArgs, ExecAskError>
Requests to send lines of text to stdin of a remote process on the server
Sourcepub async fn ask_read_proc_stdout(
&mut self,
proc: &RemoteProc,
) -> Result<ProcStdoutContentsArgs, ExecAskError>
pub async fn ask_read_proc_stdout( &mut self, proc: &RemoteProc, ) -> Result<ProcStdoutContentsArgs, ExecAskError>
Requests to get all stdout from a remote process on the server since the last ask was made
Sourcepub async fn ask_read_proc_stderr(
&mut self,
proc: &RemoteProc,
) -> Result<ProcStderrContentsArgs, ExecAskError>
pub async fn ask_read_proc_stderr( &mut self, proc: &RemoteProc, ) -> Result<ProcStderrContentsArgs, ExecAskError>
Requests to get all stderr from a remote process on the server since the last ask was made
Sourcepub async fn ask_read_proc_status(
&mut self,
proc: &RemoteProc,
) -> Result<ProcStatusArgs, ExecAskError>
pub async fn ask_read_proc_status( &mut self, proc: &RemoteProc, ) -> Result<ProcStatusArgs, ExecAskError>
Requests to read the status of a remote process on the server
Sourcepub async fn ask_proc_kill(
&mut self,
proc: &RemoteProc,
) -> Result<ProcKilledArgs, ExecAskError>
pub async fn ask_proc_kill( &mut self, proc: &RemoteProc, ) -> Result<ProcKilledArgs, ExecAskError>
Requests to kill a remote process on the server
Sourcepub async fn ask_internal_debug(
&mut self,
) -> Result<InternalDebugArgs, AskError>
pub async fn ask_internal_debug( &mut self, ) -> Result<InternalDebugArgs, AskError>
Requests internal state of server