pub struct WebSocketTransportConfig {
pub request_timeout: Duration,
pub extra_headers: HashMap<String, String>,
pub max_message_size: usize,
}Expand description
Configuration for WebSocketTransport::connect_with_config.
Fields§
§request_timeout: DurationTimeout for unary responses and for the first frame of a stream. Default: 30 seconds.
extra_headers: HashMap<String, String>Extra HTTP headers for the WebSocket upgrade request (e.g. an
Authorization header produced by an
AuthInterceptor).
max_message_size: usizeMaximum size of an incoming WebSocket message, in bytes, enforced at the protocol level during the read. Default: 32 MiB — the same response-size ceiling the HTTP and gRPC transports apply, replacing tungstenite’s 64 MiB default.
Implementations§
Source§impl WebSocketTransportConfig
impl WebSocketTransportConfig
Sourcepub const fn with_request_timeout(self, timeout: Duration) -> Self
pub const fn with_request_timeout(self, timeout: Duration) -> Self
Sets the request timeout.
Sourcepub fn with_extra_headers(self, headers: HashMap<String, String>) -> Self
pub fn with_extra_headers(self, headers: HashMap<String, String>) -> Self
Sets extra HTTP headers for the upgrade request.
Sourcepub const fn with_max_message_size(self, max_bytes: usize) -> Self
pub const fn with_max_message_size(self, max_bytes: usize) -> Self
Sets the maximum incoming message size in bytes.
Trait Implementations§
Source§impl Clone for WebSocketTransportConfig
impl Clone for WebSocketTransportConfig
Source§fn clone(&self) -> WebSocketTransportConfig
fn clone(&self) -> WebSocketTransportConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 WebSocketTransportConfig
impl Debug for WebSocketTransportConfig
Auto Trait Implementations§
impl Freeze for WebSocketTransportConfig
impl RefUnwindSafe for WebSocketTransportConfig
impl Send for WebSocketTransportConfig
impl Sync for WebSocketTransportConfig
impl Unpin for WebSocketTransportConfig
impl UnsafeUnpin for WebSocketTransportConfig
impl UnwindSafe for WebSocketTransportConfig
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