pub struct ClientConfig { /* private fields */ }Expand description
Re-exported so callers can configure WebA2AClient::auto_connect_with
without also depending on a2a-rs directly.
Client-side connection settings applied to every transport built during
negotiation, and to the agent-card fetch that precedes it.
The agent card describes where and how to reach an agent; this describes what the caller brings to the call. Both are needed to build a usable client, and only the card comes off the wire.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn new() -> ClientConfig
pub fn new() -> ClientConfig
Unauthenticated, transport-default timeout.
Sourcepub fn with_auth_token(self, token: impl Into<String>) -> ClientConfig
pub fn with_auth_token(self, token: impl Into<String>) -> ClientConfig
Send token as an HTTP Authorization: Bearer credential.
Sourcepub fn with_timeout(self, secs: u64) -> ClientConfig
pub fn with_timeout(self, secs: u64) -> ClientConfig
Bound each request to secs seconds.
Sourcepub fn auth_token(&self) -> Option<&str>
pub fn auth_token(&self) -> Option<&str>
The bearer token, when one was set.
Sourcepub fn timeout_secs(&self) -> Option<u64>
pub fn timeout_secs(&self) -> Option<u64>
The per-request timeout in seconds, when one was set.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientConfig
Redacts the token. A derived Debug would print the credential verbatim,
and this type is exactly the thing a caller reaches for when tracing why a
connection did not authenticate — so the one line most likely to be written
is the one that must not carry the secret.
impl Debug for ClientConfig
Redacts the token. A derived Debug would print the credential verbatim,
and this type is exactly the thing a caller reaches for when tracing why a
connection did not authenticate — so the one line most likely to be written
is the one that must not carry the secret.