Struct ServerHandshake
pub struct ServerHandshake<S, C> { /* private fields */ }Available on crate feature
ws only.Expand description
Server handshake role.
Implementations§
§impl<S, C> ServerHandshake<S, C>
impl<S, C> ServerHandshake<S, C>
pub fn start(
stream: S,
callback: C,
config: Option<WebSocketConfig>,
) -> MidHandshake<ServerHandshake<S, C>>
Available on crate feature handshake only.
pub fn start( stream: S, callback: C, config: Option<WebSocketConfig>, ) -> MidHandshake<ServerHandshake<S, C>>
handshake only.Start server handshake. callback specifies a custom callback which the user can pass to
the handshake, this callback will be called when the a websocket client connects to the
server, you can specify the callback if you want to add additional header to the client
upon join based on the incoming headers.
Trait Implementations§
§impl<S, C> Debug for ServerHandshake<S, C>
impl<S, C> Debug for ServerHandshake<S, C>
impl<S, C> HandshakeRole for ServerHandshake<S, C>
Auto Trait Implementations§
impl<S, C> Freeze for ServerHandshake<S, C>where
C: Freeze,
impl<S, C> !RefUnwindSafe for ServerHandshake<S, C>
impl<S, C> Send for ServerHandshake<S, C>
impl<S, C> Sync for ServerHandshake<S, C>
impl<S, C> Unpin for ServerHandshake<S, C>
impl<S, C> !UnwindSafe for ServerHandshake<S, 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more