pub struct AgentClient { /* private fields */ }Implementations§
Source§impl AgentClient
impl AgentClient
pub async fn connect( endpoint: &str, box_id: &str, ca_pem: &str, client_identity: &CertificateMaterial, ) -> Result<Self, AgentClientError>
Sourcepub async fn connect_with_relay(
endpoint: &str,
box_id: &str,
ca_pem: &str,
client_identity: &CertificateMaterial,
relay: Option<&RelayAccess>,
) -> Result<Self, AgentClientError>
pub async fn connect_with_relay( endpoint: &str, box_id: &str, ca_pem: &str, client_identity: &CertificateMaterial, relay: Option<&RelayAccess>, ) -> Result<Self, AgentClientError>
Connect directly or carry the same mutual TLS connection through a relay.
pub async fn connect_with_relay_route( endpoint: &str, box_id: &str, ca_pem: &str, client_identity: &CertificateMaterial, relay: Option<&RelayAccess>, route: &str, ) -> Result<Self, AgentClientError>
pub async fn info(&mut self) -> Result<InfoResponse, AgentClientError>
pub async fn ping(&mut self) -> Result<PingResponse, AgentClientError>
pub async fn exec( &mut self, argv: Vec<String>, cwd: impl Into<String>, env: impl IntoIterator<Item = (String, String)>, user: impl Into<String>, ) -> Result<ExecResult, AgentClientError>
pub async fn exec_pty( &mut self, argv: Vec<String>, cwd: impl Into<String>, env: impl IntoIterator<Item = (String, String)>, user: impl Into<String>, stdin: Vec<u8>, ) -> Result<ExecResult, AgentClientError>
pub async fn exec_stream<S>(
&mut self,
requests: S,
) -> Result<Streaming<ExecEvent>, AgentClientError>where
S: IntoStreamingRequest<Message = ExecRequest>,
pub async fn exec_pty_session( &mut self, argv: Vec<String>, cwd: impl Into<String>, env: impl IntoIterator<Item = (String, String)>, user: impl Into<String>, ) -> Result<ExecPtySession, AgentClientError>
pub async fn exec_pty_session_with_size( &mut self, argv: Vec<String>, cwd: impl Into<String>, env: impl IntoIterator<Item = (String, String)>, user: impl Into<String>, terminal_rows: u32, terminal_cols: u32, ) -> Result<ExecPtySession, AgentClientError>
Sourcepub async fn terminal_session(
&mut self,
request: ExecRequest,
) -> Result<ExecPtySession, AgentClientError>
pub async fn terminal_session( &mut self, request: ExecRequest, ) -> Result<ExecPtySession, AgentClientError>
Attach to an agent-owned terminal, creating it when its name is unused.
pub async fn list_sessions( &mut self, ) -> Result<Vec<TerminalSession>, AgentClientError>
pub async fn start_session( &mut self, request: ExecRequest, ) -> Result<TerminalSession, AgentClientError>
pub async fn read_session( &mut self, name: impl Into<String>, ) -> Result<ReadSessionResponse, AgentClientError>
pub async fn read_session_history( &mut self, name: impl Into<String>, ) -> Result<ReadSessionResponse, AgentClientError>
pub async fn send_session( &mut self, name: impl Into<String>, text: String, keys: Vec<String>, ) -> Result<(), AgentClientError>
pub async fn close_session( &mut self, name: impl Into<String>, ) -> Result<(), AgentClientError>
pub async fn exec_with_mode( &mut self, argv: Vec<String>, cwd: impl Into<String>, env: impl IntoIterator<Item = (String, String)>, user: impl Into<String>, allocate_pty: bool, stdin: Vec<u8>, ) -> Result<ExecResult, AgentClientError>
pub async fn forward_stream<S>(
&mut self,
requests: S,
) -> Result<Streaming<ForwardEvent>, AgentClientError>where
S: IntoStreamingRequest<Message = ForwardEvent>,
pub async fn forward_tcp( &mut self, socket: TcpStream, host: impl Into<String>, port: u16, ) -> Result<(), AgentClientError>
pub async fn put_file( &mut self, path: impl Into<String>, data: Vec<u8>, mode: u32, atomic_write: bool, ) -> Result<FileResult, AgentClientError>
pub async fn get_file( &mut self, path: impl Into<String>, ) -> Result<Vec<u8>, AgentClientError>
Trait Implementations§
Source§impl Clone for AgentClient
impl Clone for AgentClient
Source§fn clone(&self) -> AgentClient
fn clone(&self) -> AgentClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for AgentClient
impl !RefUnwindSafe for AgentClient
impl !UnwindSafe for AgentClient
impl Send for AgentClient
impl Sync for AgentClient
impl Unpin for AgentClient
impl UnsafeUnpin for AgentClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request