pub enum PeerWireProtocolMessage<P>where
P: PeerProtocol,{
KeepAlive,
Choke,
UnChoke,
Interested,
UnInterested,
Have(HaveMessage),
BitField(BitFieldMessage),
Request(RequestMessage),
Piece(PieceMessage),
Cancel(CancelMessage),
BitsExtension(BitsExtensionMessage),
ProtExtension(P::ProtocolMessage),
}Expand description
Enumeration of messages for PeerWireProtocol.
Variants§
KeepAlive
Message to keep the connection alive.
Choke
Message to tell a peer we will not be responding to their requests.
Peers may wish to send *Interested and/or KeepAlive messages.
UnChoke
Message to tell a peer we will now be responding to their requests.
Interested
Message to tell a peer we are interested in downloading pieces from them.
UnInterested
Message to tell a peer we are not interested in downloading pieces from them.
Have(HaveMessage)
Message to tell a peer we have some (validated) piece.
BitField(BitFieldMessage)
Message to effectively send multiple HaveMessages in a single message.
This message is only valid when the connection is initiated with the peer.
Request(RequestMessage)
Message to request a block from a peer.
Piece(PieceMessage)
Message from a peer containing a block.
Cancel(CancelMessage)
Message to cancel a block request from a peer.
BitsExtension(BitsExtensionMessage)
Extension messages which are activated via the ExtensionBits as part of the handshake.
ProtExtension(P::ProtocolMessage)
Extension messages which are activated via the Extension Protocol.
In reality, this can be any type that implements ProtocolMessage if, for example,
you are running a private swarm where you know all nodes support a given message(s).