pub struct GrpcTransportConfig {
pub timeout: Duration,
pub connect_timeout: Duration,
pub max_message_size: usize,
pub stream_channel_capacity: usize,
}Expand description
Configuration for the gRPC transport.
§Example
use a2a_protocol_client::transport::grpc::GrpcTransportConfig;
use std::time::Duration;
let config = GrpcTransportConfig::default()
.with_timeout(Duration::from_secs(60))
.with_max_message_size(8 * 1024 * 1024);Fields§
§timeout: DurationRequest timeout for unary calls. Default: 30 seconds.
connect_timeout: DurationConnection timeout. Default: 10 seconds.
max_message_size: usizeMaximum inbound message size. Default: 4 MiB.
stream_channel_capacity: usizeChannel capacity for streaming responses. Default: 64.
Implementations§
Source§impl GrpcTransportConfig
impl GrpcTransportConfig
Sourcepub const fn with_timeout(self, timeout: Duration) -> Self
pub const fn with_timeout(self, timeout: Duration) -> Self
Sets the unary request timeout.
Sourcepub const fn with_connect_timeout(self, timeout: Duration) -> Self
pub const fn with_connect_timeout(self, timeout: Duration) -> Self
Sets the connection timeout.
Sourcepub const fn with_max_message_size(self, size: usize) -> Self
pub const fn with_max_message_size(self, size: usize) -> Self
Sets the maximum inbound message size.
Sourcepub const fn with_stream_channel_capacity(self, capacity: usize) -> Self
pub const fn with_stream_channel_capacity(self, capacity: usize) -> Self
Sets the channel capacity for streaming responses.
Trait Implementations§
Source§impl Clone for GrpcTransportConfig
impl Clone for GrpcTransportConfig
Source§fn clone(&self) -> GrpcTransportConfig
fn clone(&self) -> GrpcTransportConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GrpcTransportConfig
impl Debug for GrpcTransportConfig
Auto Trait Implementations§
impl Freeze for GrpcTransportConfig
impl RefUnwindSafe for GrpcTransportConfig
impl Send for GrpcTransportConfig
impl Sync for GrpcTransportConfig
impl Unpin for GrpcTransportConfig
impl UnsafeUnpin for GrpcTransportConfig
impl UnwindSafe for GrpcTransportConfig
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
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