pub struct WebSocketUpgrade<S, R, C = JsonCodec> { /* private fields */ }
Expand description
A version of axum::extract::ws::WebSocketUpgrade
with type safe
messages.
§Type parameters
Implementations§
Source§impl<S, R, C> WebSocketUpgrade<S, R, C>
impl<S, R, C> WebSocketUpgrade<S, R, C>
Sourcepub fn on_upgrade<F, Fut>(self, callback: F) -> impl IntoResponse
pub fn on_upgrade<F, Fut>(self, callback: F) -> impl IntoResponse
Finalize upgrading the connection and call the provided callback with the stream.
This is analagous to axum::extract::ws::WebSocketUpgrade::on_upgrade
.
Sourcepub fn map<F>(self, f: F) -> Self
pub fn map<F>(self, f: F) -> Self
Apply a transformation to the inner axum::extract::ws::WebSocketUpgrade
.
This can be used to apply configuration.
Sourcepub fn into_inner(self) -> WebSocketUpgrade
pub fn into_inner(self) -> WebSocketUpgrade
Get the inner axum axum::extract::ws::WebSocketUpgrade
.
Trait Implementations§
Source§impl<S, R, C> Debug for WebSocketUpgrade<S, R, C>
impl<S, R, C> Debug for WebSocketUpgrade<S, R, C>
Source§impl<S, R, C, B> FromRequestParts<B> for WebSocketUpgrade<S, R, C>
impl<S, R, C, B> FromRequestParts<B> for WebSocketUpgrade<S, R, C>
Source§type Rejection = <WebSocketUpgrade as FromRequestParts<B>>::Rejection
type Rejection = <WebSocketUpgrade as FromRequestParts<B>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Auto Trait Implementations§
impl<S, R, C = JsonCodec> !Freeze for WebSocketUpgrade<S, R, C>
impl<S, R, C> RefUnwindSafe for WebSocketUpgrade<S, R, C>
impl<S, R, C> Send for WebSocketUpgrade<S, R, C>
impl<S, R, C> Sync for WebSocketUpgrade<S, R, C>
impl<S, R, C> Unpin for WebSocketUpgrade<S, R, C>
impl<S, R, C> UnwindSafe for WebSocketUpgrade<S, R, C>
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<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.