pub struct Floodsub<TSubstream> { /* private fields */ }
Expand description

Network behaviour that automatically identifies nodes periodically, and returns information about them.

Implementations

Creates a Floodsub.

Subscribes to a topic.

Returns true if the subscription worked. Returns false if we were already subscribed.

Unsubscribes from a topic.

Note that this only requires a TopicHash and not a full Topic.

Returns true if we were subscribed to this topic.

Publishes a message to the network.

Note: Doesn’t do anything if we’re not subscribed to the topic.

Publishes a message with multiple topics to the network.

Note: Doesn’t do anything if we’re not subscribed to any of the topics.

Trait Implementations

Handler for all the protocols the network supports.
Event generated by the swarm.
Builds a new ProtocolsHandler.
Indicates the behaviour that we connected to the node with the given peer id through the given endpoint. Read more
Indicates the behaviour that we disconnected from the node with the given peer id. The endpoint is the one we used to be connected to. Read more
Indicates the behaviour that the node with the given peer id has generated an event for us. Read more
Polls for things that swarm should do. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.