Struct network::protocols::wire::handshake::v1::HandshakeMsg [−][src]
pub struct HandshakeMsg {
pub supported_protocols: BTreeMap<MessagingProtocolVersion, ProtocolIdSet>,
pub chain_id: ChainId,
pub network_id: NetworkId,
}Expand description
The HandshakeMsg contains a mapping from MessagingProtocolVersion
suppported by the node to a bit-vector specifying application-level protocols
supported over that version.
Fields
supported_protocols: BTreeMap<MessagingProtocolVersion, ProtocolIdSet>chain_id: ChainIdnetwork_id: NetworkIdImplementations
pub fn perform_handshake(
&self,
other: &HandshakeMsg
) -> Result<(MessagingProtocolVersion, ProtocolIdSet), HandshakeError>
pub fn perform_handshake(
&self,
other: &HandshakeMsg
) -> Result<(MessagingProtocolVersion, ProtocolIdSet), HandshakeError>
This function:
- verifies that both HandshakeMsg are compatible and
- finds out the intersection of protocols that is supported
Trait Implementations
Returns the “default value” for a type. Read more
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 RefUnwindSafe for HandshakeMsg
impl Send for HandshakeMsg
impl Sync for HandshakeMsg
impl Unpin for HandshakeMsg
impl UnwindSafe for HandshakeMsg
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self
Generates a hash used only for tests.