pub struct HelloEnvelope {
pub kind: HelloKind,
pub version: u32,
pub identity: PeerIdentity,
}Expand description
Identity block sent once in each direction when a WebSocket link comes up
(RFC 017 §8). Version 2 is the first with a structured identity field;
version 1 is implicit in pre-RFC-017 code.
Fields§
§kind: HelloKindWire tag discriminating this frame from other possible envelopes.
version: u32Version of the hello envelope schema. Must be >= 2.
identity: PeerIdentityThe sender’s identity block.
Implementations§
Source§impl HelloEnvelope
impl HelloEnvelope
Sourcepub const CURRENT_VERSION: u32 = 2
pub const CURRENT_VERSION: u32 = 2
The hello envelope schema version this build emits.
Sourcepub const MIN_SUPPORTED_VERSION: u32 = 2
pub const MIN_SUPPORTED_VERSION: u32 = 2
The minimum hello envelope version this build will accept from a peer.
Sourcepub fn new(identity: PeerIdentity) -> Self
pub fn new(identity: PeerIdentity) -> Self
Construct a new hello envelope at Self::CURRENT_VERSION carrying
identity.
Trait Implementations§
Source§impl Clone for HelloEnvelope
impl Clone for HelloEnvelope
Source§fn clone(&self) -> HelloEnvelope
fn clone(&self) -> HelloEnvelope
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 HelloEnvelope
impl Debug for HelloEnvelope
Source§impl<'de> Deserialize<'de> for HelloEnvelope
impl<'de> Deserialize<'de> for HelloEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HelloEnvelope
impl RefUnwindSafe for HelloEnvelope
impl Send for HelloEnvelope
impl Sync for HelloEnvelope
impl Unpin for HelloEnvelope
impl UnsafeUnpin for HelloEnvelope
impl UnwindSafe for HelloEnvelope
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