pub enum Handshake<T>{
Client(ClientHandshake),
Server(ServerHandshake<T>),
}Expand description
A merged handshake state that can be used by both the client and the server.
For convenience, a unified Handshake` should be used,
which will internally choose the corresponding behavior based on the role.
Variants§
Client(ClientHandshake)
The client’s handshake state if the endpoint is a client.
Server(ServerHandshake<T>)
The server’s handshake state if the endpoint is a server.
Implementations§
Source§impl<T> Handshake<T>
impl<T> Handshake<T>
Sourcepub fn new_client() -> Self
pub fn new_client() -> Self
Create a new client handshake state.
Sourcepub fn new_server(output: T) -> Self
pub fn new_server(output: T) -> Self
Create a new server handshake state.
The output is responsible for sending the HandshakeDoneFrame to the client,
see ServerHandshake::new.
Sourcepub fn is_handshake_done(&self) -> bool
pub fn is_handshake_done(&self) -> bool
Check if the handshake is complete.
Trait Implementations§
Source§impl<T> ReceiveFrame<HandshakeDoneFrame> for Handshake<T>
impl<T> ReceiveFrame<HandshakeDoneFrame> for Handshake<T>
Source§fn recv_frame(&self, frame: HandshakeDoneFrame) -> Result<bool, Error>
fn recv_frame(&self, frame: HandshakeDoneFrame) -> Result<bool, Error>
Receive the HandshakeDoneFrame.
A HandshakeDoneFrame can only be received by the client.
A server MUST treat receipt of a HandshakeDoneFrame
as a connection error of type PROTOCOL_VIOLATION.
See section 19.20
of QUIC.
Return whether it is the first time to receive the HANDSHAKE_DONE frame(for client).