pub struct NegotiationHeader {
pub magic: u32,
pub command: u32,
pub header_size: u32,
pub buffer_size: u32,
pub cipher_size: u32,
}Expand description
Negotiation header that opens every entropy connection.
All five fields are 32-bit big-endian unsigned integers on the wire.
Fields§
§magic: u32Magic word; must equal ENTROPY_MAGIC.
command: u32Direction marker. ENTROPY_COMMAND_SEND = data flows
from sender to receiver.
header_size: u32Snapshot-header size, in bytes.
buffer_size: u32Plaintext chunk size, in bytes.
cipher_size: u32Ciphertext chunk capacity, in bytes.
Implementations§
Source§impl NegotiationHeader
impl NegotiationHeader
Sourcepub fn from_wire(bytes: &[u8; 20]) -> Result<Self, EntropyError>
pub fn from_wire(bytes: &[u8; 20]) -> Result<Self, EntropyError>
Decode and validate a wire-format negotiation header.
§Errors
EntropyError::Protocol if any field is out of range or
the magic word is wrong.
Trait Implementations§
Source§impl Clone for NegotiationHeader
impl Clone for NegotiationHeader
Source§fn clone(&self) -> NegotiationHeader
fn clone(&self) -> NegotiationHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NegotiationHeader
impl Debug for NegotiationHeader
Source§impl PartialEq for NegotiationHeader
impl PartialEq for NegotiationHeader
Source§fn eq(&self, other: &NegotiationHeader) -> bool
fn eq(&self, other: &NegotiationHeader) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for NegotiationHeader
impl Eq for NegotiationHeader
impl StructuralPartialEq for NegotiationHeader
Auto Trait Implementations§
impl Freeze for NegotiationHeader
impl RefUnwindSafe for NegotiationHeader
impl Send for NegotiationHeader
impl Sync for NegotiationHeader
impl Unpin for NegotiationHeader
impl UnsafeUnpin for NegotiationHeader
impl UnwindSafe for NegotiationHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.