pub struct ClientConfig {
pub preferred_bindings: Vec<String>,
pub accepted_output_modes: Vec<String>,
pub history_length: Option<u32>,
pub return_immediately: bool,
pub request_timeout: Duration,
pub stream_connect_timeout: Duration,
pub connection_timeout: Duration,
pub tls: TlsConfig,
}Expand description
Configuration for an crate::A2aClient instance.
Build via crate::ClientBuilder. Reasonable defaults are provided for all
fields; most users only need to set the agent URL.
Fields§
§preferred_bindings: Vec<String>Ordered list of preferred protocol bindings.
The client tries each in order, selecting the first one supported by the
target agent’s card. Defaults to ["JSONRPC"].
accepted_output_modes: Vec<String>MIME types the client will advertise in acceptedOutputModes.
Defaults to ["text/plain", "application/json"].
history_length: Option<u32>Number of historical messages to include in task responses.
None means use the agent’s default.
return_immediately: boolIf true, send_message returns immediately with the submitted task
rather than waiting for completion.
request_timeout: DurationPer-request timeout for non-streaming calls.
Defaults to 30 seconds.
stream_connect_timeout: DurationPer-request timeout for establishing the SSE stream.
Once the stream is established this timeout no longer applies. Defaults to 30 seconds.
connection_timeout: DurationTCP connection timeout (DNS + handshake).
Prevents the client from hanging for the OS default (~2 minutes) when the server is unreachable. Defaults to 10 seconds.
tls: TlsConfigTLS configuration.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn default_http() -> ClientConfig
pub fn default_http() -> ClientConfig
Returns the default configuration suitable for connecting to a local or well-known agent over plain HTTP.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientConfig
impl Debug for ClientConfig
Source§impl Default for ClientConfig
impl Default for ClientConfig
Source§fn default() -> ClientConfig
fn default() -> ClientConfig
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin for ClientConfig
impl UnwindSafe for ClientConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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>
T in a tonic::Request