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.