Struct tungstenite::handshake::machine::HandshakeMachine
source · pub struct HandshakeMachine<Stream> { /* private fields */ }
Expand description
A generic handshake state machine.
Implementations§
source§impl<Stream> HandshakeMachine<Stream>
impl<Stream> HandshakeMachine<Stream>
sourcepub fn start_read(stream: Stream) -> Self
pub fn start_read(stream: Stream) -> Self
Start reading data from the peer.
sourcepub fn start_write<D: Into<Vec<u8>>>(stream: Stream, data: D) -> Self
pub fn start_write<D: Into<Vec<u8>>>(stream: Stream, data: D) -> Self
Start writing data to the peer.
sourcepub fn get_mut(&mut self) -> &mut Stream
pub fn get_mut(&mut self) -> &mut Stream
Returns a mutable reference to the inner stream.
source§impl<Stream: Read + Write> HandshakeMachine<Stream>
impl<Stream: Read + Write> HandshakeMachine<Stream>
sourcepub fn single_round<Obj: TryParse>(self) -> Result<RoundResult<Obj, Stream>>
pub fn single_round<Obj: TryParse>(self) -> Result<RoundResult<Obj, Stream>>
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