Skip to main content

ConnectedClient

Struct ConnectedClient 

Source
pub struct ConnectedClient {
    pub timeout: Duration,
    /* private fields */
}
Expand description

Represents a client after connecting to an endpoint

Fields§

§timeout: Duration

Represents maximum to wait on responses before timing out

Implementations§

Source§

impl ConnectedClient

Source

pub const DEFAULT_TIMEOUT: Duration

Default timeout applied to a new client for any ask made

Source

pub fn remote_addr(&self) -> SocketAddr

Source

pub async fn wait(self) -> Result<(), JoinError>

Source

pub async fn ask(&mut self, request: Request) -> Result<Reply, AskError>

Generic ask of the server that is expecting a response

Source

pub async fn tell(&mut self, request: Request) -> Result<(), SendError>

Sends a msg to the server, not expecting a response

Source

pub async fn ask_heartbeat(&mut self) -> Result<(), AskError>

Requests heartbeat from the server

Source

pub async fn ask_version(&mut self) -> Result<VersionArgs, AskError>

Requests the version from the server

Source

pub async fn ask_capabilities(&mut self) -> Result<CapabilitiesArgs, AskError>

Requests the capabilities from the server

Source

pub async fn ask_create_dir( &mut self, path: String, include_components: bool, ) -> Result<DirCreatedArgs, FileAskError>

Requests to create a new directory

Source

pub async fn ask_rename_dir( &mut self, from: String, to: String, ) -> Result<DirRenamedArgs, FileAskError>

Requests to rename an existing directory

Source

pub async fn ask_remove_dir( &mut self, path: String, non_empty: bool, ) -> Result<DirRemovedArgs, FileAskError>

Requests to remove an existing directory

Source

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

Source

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

Source

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

Source

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

Source

pub async fn ask_close_file( &mut self, file: &RemoteFile, ) -> Result<FileClosedArgs, FileAskError>

Requests to close an open file

Source

pub async fn ask_rename_file( &mut self, file: &mut RemoteFile, to: String, ) -> Result<FileRenamedArgs, FileAskError>

Requests to rename an open file

Source

pub async fn ask_rename_unopened_file( &mut self, from: String, to: String, ) -> Result<UnopenedFileRenamedArgs, FileAskError>

Requests to rename a non-open file

Source

pub async fn ask_remove_file( &mut self, file: &mut RemoteFile, ) -> Result<FileRemovedArgs, FileAskError>

Requests to remove an open file

Source

pub async fn ask_remove_unopened_file( &mut self, path: String, ) -> Result<UnopenedFileRemovedArgs, FileAskError>

Requests to remove a non-open file

Source

pub async fn ask_read_file( &mut self, file: &RemoteFile, ) -> Result<FileContentsArgs, FileAskError>

Requests the full contents of a file on the server

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub async fn ask_proc_kill( &mut self, proc: &RemoteProc, ) -> Result<ProcKilledArgs, ExecAskError>

Requests to kill a remote process on the server

Source

pub async fn ask_internal_debug( &mut self, ) -> Result<InternalDebugArgs, AskError>

Requests internal state of server

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V