pub struct HandshakeOffer {
pub peer_id: String,
pub protocol_version: ProtocolVersion,
pub supported_features: Vec<FeatureFlag>,
pub max_frame_size: u32,
pub timestamp_ms: u64,
}Expand description
The packet a peer sends at the start of a connection to advertise its capabilities.
Fields§
§peer_id: StringPeer identifier of the sender.
protocol_version: ProtocolVersionProtocol version spoken by the sender.
supported_features: Vec<FeatureFlag>Feature flags supported by the sender.
max_frame_size: u32Maximum frame size (in bytes) the sender can handle. Default: 4 MiB.
timestamp_ms: u64Wall-clock timestamp at offer creation (milliseconds since UNIX epoch).
Implementations§
Source§impl HandshakeOffer
impl HandshakeOffer
Sourcepub const DEFAULT_MAX_FRAME_SIZE: u32 = DEFAULT_MAX_FRAME_SIZE
pub const DEFAULT_MAX_FRAME_SIZE: u32 = DEFAULT_MAX_FRAME_SIZE
Default maximum frame size (4 MiB).
Sourcepub fn feature_bits(&self) -> u32
pub fn feature_bits(&self) -> u32
Encode supported_features as a u32 bitmask.
Trait Implementations§
Source§impl Clone for HandshakeOffer
impl Clone for HandshakeOffer
Source§fn clone(&self) -> HandshakeOffer
fn clone(&self) -> HandshakeOffer
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 HandshakeOffer
impl Debug for HandshakeOffer
Source§impl<'de> Deserialize<'de> for HandshakeOffer
impl<'de> Deserialize<'de> for HandshakeOffer
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 HandshakeOffer
impl RefUnwindSafe for HandshakeOffer
impl Send for HandshakeOffer
impl Sync for HandshakeOffer
impl Unpin for HandshakeOffer
impl UnsafeUnpin for HandshakeOffer
impl UnwindSafe for HandshakeOffer
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more