pub struct AgentClient {
pub name: String,
pub address: String,
pub port: u16,
/* private fields */
}Expand description
How the control plane reaches one agent.
Fields§
§name: String§address: String§port: u16Implementations§
Source§impl AgentClient
impl AgentClient
pub fn new(name: &str, address: &str, port: u16, tls: Arc<ClientConfig>) -> Self
Sourcepub fn peer_fingerprint(&self) -> Result<String>
pub fn peer_fingerprint(&self) -> Result<String>
SHA-256 of the certificate the agent presents now.
Sourcepub fn request(
&self,
method: &str,
path: &str,
headers: &[(String, String)],
body: &[u8],
timeout: Duration,
) -> Result<Answer>
pub fn request( &self, method: &str, path: &str, headers: &[(String, String)], body: &[u8], timeout: Duration, ) -> Result<Answer>
One request; the answer ends where the agent closes.
Sourcepub fn call(
&self,
tool: &str,
args: &Value,
who: &Assertion,
org: Option<&OrgId>,
request_id: Option<&str>,
timeout: Duration,
) -> Result<Value>
pub fn call( &self, tool: &str, args: &Value, who: &Assertion, org: Option<&OrgId>, request_id: Option<&str>, timeout: Duration, ) -> Result<Value>
Call a tool on the agent as who, in org’s endpoint (or the
unscoped one for cross-org reads).
Sourcepub fn internal(
&self,
method: &str,
path: &str,
body: Option<&Value>,
timeout: Duration,
) -> Result<Value>
pub fn internal( &self, method: &str, path: &str, body: Option<&Value>, timeout: Duration, ) -> Result<Value>
GET or POST an internal JSON route as the control plane itself.
Sourcepub fn terminal(
&self,
who: &Assertion,
org: &OrgId,
t: &TermRequest,
) -> Result<Box<dyn Pty>>
pub fn terminal( &self, who: &Assertion, org: &OrgId, t: &TermRequest, ) -> Result<Box<dyn Pty>>
A terminal on the agent, as who.
Trait Implementations§
Source§impl Clone for AgentClient
impl Clone for AgentClient
Auto Trait Implementations§
impl !RefUnwindSafe for AgentClient
impl !UnwindSafe for AgentClient
impl Freeze for AgentClient
impl Send for AgentClient
impl Sync for AgentClient
impl Unpin for AgentClient
impl UnsafeUnpin for AgentClient
Blanket Implementations§
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