Enum libp2p::gossipsub::GossipsubEvent[][src]

pub enum GossipsubEvent {
    Message {
        propagation_source: PeerId,
        message_id: MessageId,
        message: GossipsubMessage,
    },
    Subscribed {
        peer_id: PeerId,
        topic: TopicHash,
    },
    Unsubscribed {
        peer_id: PeerId,
        topic: TopicHash,
    },
}
Expand description

Event that can be emitted by the gossipsub behaviour.

Variants

Message

A message has been received.

Show fields

Fields of Message

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.

Subscribed

A remote subscribed to a topic.

Show fields

Fields of Subscribed

peer_id: PeerId

Remote that has subscribed.

topic: TopicHash

The topic it has subscribed to.

Unsubscribed

A remote unsubscribed from a topic.

Show fields

Fields of Unsubscribed

peer_id: PeerId

Remote that has unsubscribed.

topic: TopicHash

The topic it has subscribed from.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.