Struct HandshakeMachine
pub struct HandshakeMachine<Stream> { /* private fields */ }Available on crate features
ws and handshake only.Expand description
A generic handshake state machine.
Implementations§
§impl<Stream> HandshakeMachine<Stream>
impl<Stream> HandshakeMachine<Stream>
pub fn start_read(stream: Stream) -> HandshakeMachine<Stream>
pub fn start_read(stream: Stream) -> HandshakeMachine<Stream>
Start reading data from the peer.
pub fn start_write<D>(stream: Stream, data: D) -> HandshakeMachine<Stream>
pub fn start_write<D>(stream: Stream, data: D) -> HandshakeMachine<Stream>
Start writing data to the peer.
pub fn get_mut(&mut self) -> &mut Stream
pub fn get_mut(&mut self) -> &mut Stream
Returns a mutable reference to the inner stream.
§impl<Stream> HandshakeMachine<Stream>
impl<Stream> HandshakeMachine<Stream>
pub fn single_round<Obj>(self) -> Result<RoundResult<Obj, Stream>, Error>where
Obj: TryParse,
pub fn single_round<Obj>(self) -> Result<RoundResult<Obj, Stream>, Error>where
Obj: TryParse,
Perform a single handshake round.
Trait Implementations§
Auto Trait Implementations§
impl<Stream> Freeze for HandshakeMachine<Stream>where
Stream: Freeze,
impl<Stream> RefUnwindSafe for HandshakeMachine<Stream>where
Stream: RefUnwindSafe,
impl<Stream> Send for HandshakeMachine<Stream>where
Stream: Send,
impl<Stream> Sync for HandshakeMachine<Stream>where
Stream: Sync,
impl<Stream> Unpin for HandshakeMachine<Stream>where
Stream: Unpin,
impl<Stream> UnwindSafe for HandshakeMachine<Stream>where
Stream: UnwindSafe,
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