pub(super) struct WebSocketUpgrade {
key: HeaderValue,
on_upgrade: OnUpgrade,
protocol: Option<&'static str>,
config: WebSocketConfig,
}Expand description
A request which asks for a WebSocket, checked like RFC 6455 says.
Fields§
§key: HeaderValue§on_upgrade: OnUpgrade§protocol: Option<&'static str>§config: WebSocketConfigImplementations§
Source§impl WebSocketUpgrade
impl WebSocketUpgrade
Sourcepub(super) fn from_request<B>(
request: &mut Request<B>,
) -> Result<Self, Box<Response<Body>>>
pub(super) fn from_request<B>( request: &mut Request<B>, ) -> Result<Self, Box<Response<Body>>>
Check the request, the rejection is the response to send otherwise. The server speaks HTTP/1 only, where a WebSocket starts with a GET.
Sourcepub(super) fn protocol(self, protocol: Option<&'static str>) -> Self
pub(super) fn protocol(self, protocol: Option<&'static str>) -> Self
The subprotocol the server picked out of the ones of the client.
Sourcepub(super) fn max_message_size(self, max: usize) -> Self
pub(super) fn max_message_size(self, max: usize) -> Self
The largest message and frame the client may send.
Auto Trait Implementations§
impl !Freeze for WebSocketUpgrade
impl RefUnwindSafe for WebSocketUpgrade
impl Send for WebSocketUpgrade
impl Sync for WebSocketUpgrade
impl Unpin for WebSocketUpgrade
impl UnsafeUnpin for WebSocketUpgrade
impl UnwindSafe for WebSocketUpgrade
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].