pub struct A2AClientBuilder { /* private fields */ }Expand description
Builder for A2AClient with explicit timeouts, TLS enforcement, and auth.
Implementations§
Source§impl A2AClientBuilder
impl A2AClientBuilder
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
Use a custom reqwest::Client (overrides the timeouts configured below).
Sourcepub fn bearer_token(self, token: impl Into<String>) -> Self
pub fn bearer_token(self, token: impl Into<String>) -> Self
Send an Authorization: Bearer <token> header on every request.
Sourcepub fn enforce_https(self, enforce: bool) -> Self
pub fn enforce_https(self, enforce: bool) -> Self
Reject non-HTTPS base URLs at build time (default: off, warn only).
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Connect timeout (default 10s).
Sourcepub fn trace_id(self, trace_id: impl Into<String>) -> Self
pub fn trace_id(self, trace_id: impl Into<String>) -> Self
Attach a distributed trace_id to every request’s metadata (P1-5).
Sourcepub fn with_traceparent(self, context: TraceContext) -> Self
pub fn with_traceparent(self, context: TraceContext) -> Self
Attach a W3C trace context (P2-8).
Every request carries the context as a standard traceparent header,
and the context’s trace id is also attached to request metadata (P1-5)
so a single configuration populates both channels.
Sourcepub fn card_verification_secret(self, secret: impl Into<Vec<u8>>) -> Self
pub fn card_verification_secret(self, secret: impl Into<Vec<u8>>) -> Self
Configure a shared HMAC secret used to verify agent-card signatures (P1-3).
Sourcepub fn require_card_signature(self, require: bool) -> Self
pub fn require_card_signature(self, require: bool) -> Self
Reject signed agent cards that cannot be verified (P1-3).
When enabled, a card carrying a signature is refused unless the
configured Self::card_verification_secret verifies it. Defaults to
false (signed cards are logged, not rejected, when no secret is set).