mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-25 15:51:34 +00:00
Simplify trait bounds on NetworkBehaviour (#1405)
* Simplify trait bounds requirements * More work * Moar * Finish * Fix final tests * More simplification * Use separate traits for Inbound/Outbound * Update gossipsub and remove warnings * Add documentation to swarm * Remove BoxSubstream * Fix tests not compiling * Fix stack overflow * Address concerns * For some reason my IDE ignored libp2p-kad
This commit is contained in:
@ -43,12 +43,12 @@ use std::{error, task::Context, task::Poll};
|
||||
///
|
||||
/// `#[behaviour(ignore)]` can be added on a struct field to disable generation of delegation to
|
||||
/// the fields which do not implement `NetworkBehaviour`.
|
||||
pub trait NetworkBehaviour {
|
||||
pub trait NetworkBehaviour: Send + 'static {
|
||||
/// Handler for all the protocols the network behaviour supports.
|
||||
type ProtocolsHandler: IntoProtocolsHandler;
|
||||
|
||||
/// Event generated by the `NetworkBehaviour` and that the swarm will report back.
|
||||
type OutEvent;
|
||||
type OutEvent: Send + 'static;
|
||||
|
||||
/// Creates a new `ProtocolsHandler` for a connection with a peer.
|
||||
///
|
||||
|
Reference in New Issue
Block a user