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