Enum snarkos_node_messages::Message
source · pub enum Message<N: Network> {
Show 16 variants
BeaconPropose(BeaconPropose<N>),
BeaconTimeout(BeaconTimeout<N>),
BeaconVote(BeaconVote<N>),
BlockRequest(BlockRequest),
BlockResponse(BlockResponse<N>),
ChallengeRequest(ChallengeRequest<N>),
ChallengeResponse(ChallengeResponse<N>),
Disconnect(Disconnect),
PeerRequest(PeerRequest),
PeerResponse(PeerResponse),
Ping(Ping<N>),
Pong(Pong),
PuzzleRequest(PuzzleRequest),
PuzzleResponse(PuzzleResponse<N>),
UnconfirmedSolution(UnconfirmedSolution<N>),
UnconfirmedTransaction(UnconfirmedTransaction<N>),
}
Variants§
BeaconPropose(BeaconPropose<N>)
BeaconTimeout(BeaconTimeout<N>)
BeaconVote(BeaconVote<N>)
BlockRequest(BlockRequest)
BlockResponse(BlockResponse<N>)
ChallengeRequest(ChallengeRequest<N>)
ChallengeResponse(ChallengeResponse<N>)
Disconnect(Disconnect)
PeerRequest(PeerRequest)
PeerResponse(PeerResponse)
Ping(Ping<N>)
Pong(Pong)
PuzzleRequest(PuzzleRequest)
PuzzleResponse(PuzzleResponse<N>)
UnconfirmedSolution(UnconfirmedSolution<N>)
UnconfirmedTransaction(UnconfirmedTransaction<N>)
Implementations§
source§impl<N: Network> Message<N>
impl<N: Network> Message<N>
sourcepub const VERSION: u32 = 9u32
pub const VERSION: u32 = 9u32
The version of the network protocol; it can be incremented in order to force users to update.
sourcepub fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>
pub fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>
Serializes the message into the buffer.
sourcepub fn deserialize(bytes: BytesMut) -> Result<Self>
pub fn deserialize(bytes: BytesMut) -> Result<Self>
Deserializes the given buffer into a message.
Trait Implementations§
source§impl<N: Network> Encoder<Message<N>> for MessageCodec<N>
impl<N: Network> Encoder<Message<N>> for MessageCodec<N>
source§impl<N: PartialEq + Network> PartialEq<Message<N>> for Message<N>
impl<N: PartialEq + Network> PartialEq<Message<N>> for Message<N>
impl<N: Eq + Network> Eq for Message<N>
impl<N: Network> StructuralEq for Message<N>
impl<N: Network> StructuralPartialEq for Message<N>
Auto Trait Implementations§
impl<N> RefUnwindSafe for Message<N>where N: RefUnwindSafe, <N as Network>::BlockHash: RefUnwindSafe, <N as Environment>::Field: RefUnwindSafe, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe, <N as Environment>::Projective: RefUnwindSafe, <N as Environment>::Scalar: RefUnwindSafe, <N as Network>::StateRoot: RefUnwindSafe, <N as Network>::TransactionID: RefUnwindSafe, <N as Network>::TransitionID: RefUnwindSafe,
impl<N> Send for Message<N>
impl<N> Sync for Message<N>
impl<N> Unpin for Message<N>where N: Unpin, <N as Network>::BlockHash: Unpin, <N as Environment>::Field: Unpin, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin, <N as Environment>::Projective: Unpin, <N as Environment>::Scalar: Unpin, <N as Network>::StateRoot: Unpin, <N as Network>::TransactionID: Unpin, <N as Network>::TransitionID: Unpin,
impl<N> UnwindSafe for Message<N>where N: UnwindSafe, <N as Network>::BlockHash: UnwindSafe, <N as Environment>::Field: UnwindSafe, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: UnwindSafe + RefUnwindSafe, <N as Environment>::Projective: UnwindSafe, <N as Environment>::Scalar: UnwindSafe, <N as Network>::StateRoot: UnwindSafe, <N as Network>::TransactionID: UnwindSafe, <N as Network>::TransitionID: UnwindSafe,
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.