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,
) -> WebSocketTransportConfig
pub const fn with_request_timeout( self, timeout: Duration, ) -> WebSocketTransportConfig
Sets the request timeout.
Sourcepub fn with_extra_headers(
self,
headers: HashMap<String, String>,
) -> WebSocketTransportConfig
pub fn with_extra_headers( self, headers: HashMap<String, String>, ) -> WebSocketTransportConfig
Sets extra HTTP headers for the upgrade request.
Sourcepub const fn with_max_message_size(
self,
max_bytes: usize,
) -> WebSocketTransportConfig
pub const fn with_max_message_size( self, max_bytes: usize, ) -> WebSocketTransportConfig
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
Source§impl Default for WebSocketTransportConfig
impl Default for WebSocketTransportConfig
Source§fn default() -> WebSocketTransportConfig
fn default() -> WebSocketTransportConfig
Returns the “default value” for a type. Read more
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> 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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request