mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-02 19:21:37 +00:00
feat(swarm): allow NetworkBehaviour
s to create and remove listeners
This extends `ToSwarm` to add `ToSwarm::ListenOn` and `ToSwarm::RemoveListener`, which allows creating and removing listeners from a `NetworkBehaviour`. Resolves https://github.com/libp2p/rust-libp2p/issues/3291. Pull-Request: #3292.
This commit is contained in:
@ -732,6 +732,12 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> syn::Result<Toke
|
||||
std::task::Poll::Ready(#network_behaviour_action::Dial { opts }) => {
|
||||
return std::task::Poll::Ready(#network_behaviour_action::Dial { opts });
|
||||
}
|
||||
std::task::Poll::Ready(#network_behaviour_action::ListenOn { opts }) => {
|
||||
return std::task::Poll::Ready(#network_behaviour_action::ListenOn { opts });
|
||||
}
|
||||
std::task::Poll::Ready(#network_behaviour_action::RemoveListener { id }) => {
|
||||
return std::task::Poll::Ready(#network_behaviour_action::RemoveListener { id });
|
||||
}
|
||||
std::task::Poll::Ready(#network_behaviour_action::NotifyHandler { peer_id, handler, event }) => {
|
||||
return std::task::Poll::Ready(#network_behaviour_action::NotifyHandler {
|
||||
peer_id,
|
||||
|
Reference in New Issue
Block a user