pub struct Handshake { /* private fields */ }Expand description
Handshake state machine
Implementations§
Source§impl Handshake
impl Handshake
Sourcepub fn new(role: HandshakeRole) -> Self
pub fn new(role: HandshakeRole) -> Self
Create a new handshake state machine
Sourcepub fn bytes_needed(&self) -> usize
pub fn bytes_needed(&self) -> usize
Get bytes needed before next state transition
Sourcepub fn generate_initial(&mut self) -> Option<Bytes>
pub fn generate_initial(&mut self) -> Option<Bytes>
Generate initial packet (C0C1 for client, nothing for server initially)
For client: returns C0+C1 (1 + 1536 bytes) For server: returns None (server waits for C0C1 first)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handshake
impl RefUnwindSafe for Handshake
impl Send for Handshake
impl Sync for Handshake
impl Unpin for Handshake
impl UnwindSafe for Handshake
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