Enum libp2p_gossipsub::GossipsubEvent
source · [−]pub enum GossipsubEvent {
Message {
propagation_source: PeerId,
message_id: MessageId,
message: GossipsubMessage,
},
Subscribed {
peer_id: PeerId,
topic: TopicHash,
},
Unsubscribed {
peer_id: PeerId,
topic: TopicHash,
},
GossipsubNotSupported {
peer_id: PeerId,
},
}
Expand description
Event that can be emitted by the gossipsub behaviour.
Variants
Message
Fields
propagation_source: PeerId
The peer that forwarded us this message.
message_id: MessageId
The MessageId
of the message. This should be referenced by the application when
validating a message (if required).
message: GossipsubMessage
The decompressed message itself.
A message has been received.
Subscribed
A remote subscribed to a topic.
Unsubscribed
Fields
peer_id: PeerId
Remote that has unsubscribed.
topic: TopicHash
The topic it has subscribed from.
A remote unsubscribed from a topic.
GossipsubNotSupported
Fields
peer_id: PeerId
A peer that does not support gossipsub has connected.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GossipsubEvent
impl Send for GossipsubEvent
impl Sync for GossipsubEvent
impl Unpin for GossipsubEvent
impl UnwindSafe for GossipsubEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more