pub struct Nonce { /* private fields */ }Expand description
A nonce. This is unique for all messages on a connection.
Implementations§
Source§impl Nonce
impl Nonce
Sourcepub fn new(iv: &Iv, seq: u64) -> Self
pub fn new(iv: &Iv, seq: u64) -> Self
Combine an Iv and sequence number to produce a unique nonce.
This is iv ^ seq where seq is encoded as a big-endian integer.
Sourcepub fn quic(path_id: Option<u32>, iv: &Iv, pn: u64) -> Self
pub fn quic(path_id: Option<u32>, iv: &Iv, pn: u64) -> Self
Creates a unique nonce based on the multipath path_id, the iv and packet number pn.
The nonce is computed as the XOR between the iv and the big-endian integer formed
by concatenating path_id (or 0) and pn.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Nonce
impl RefUnwindSafe for Nonce
impl Send for Nonce
impl Sync for Nonce
impl Unpin for Nonce
impl UnwindSafe for Nonce
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