pub enum Event<W: Write> {
Connected(Sender<W>),
Disconnected,
Message(Vec<u8>),
}Expand description
A decrypted message or encrypted session transition returned by Server::recv.
Events arrive in receive order and refer to sessions over the existing byte
stream. Permanent stream closure is observed through I/O results.
Variants§
Connected(Sender<W>)
A handshake completed and established an encrypted session. The sender belongs to that session and cannot send into a later replacement. Concurrent send failure or stream closure may make it unusable before the caller handles the event.
Disconnected
The previously opened session ended through a peer reset, invalid
incoming data or an observed send failure. After a peer reset, the next
receive call runs the handshake. A local Server::disconnect does not emit this
event. Permanent stream closure is reported through I/O results instead.
Message(Vec<u8>)
A decrypted message from the client.