mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-28 10:11:19 +00:00
swarm/src/handler: Add impl IntoIterator for MultiHandler (#2572)
This commit is contained in:
parent
6b5744c33d
commit
d81ad52ff8
@ -1,7 +1,9 @@
|
||||
# 0.35.0 [unreleased]
|
||||
|
||||
- Add impl `IntoIterator` for `MultiHandler`. See [PR 2572].
|
||||
- Remove `Send` bound from `NetworkBehaviour`. See [PR 2535].
|
||||
|
||||
[PR 2572]: https://github.com/libp2p/rust-libp2p/pull/2572/
|
||||
[PR 2535]: https://github.com/libp2p/rust-libp2p/pull/2535/
|
||||
|
||||
# 0.34.0 [2022-02-22]
|
||||
|
@ -319,6 +319,16 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Split [`MultiHandler`] into parts.
|
||||
impl<K, H> IntoIterator for MultiHandler<K, H> {
|
||||
type Item = <Self::IntoIter as Iterator>::Item;
|
||||
type IntoIter = std::collections::hash_map::IntoIter<K, H>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.handlers.into_iter()
|
||||
}
|
||||
}
|
||||
|
||||
/// A [`IntoConnectionHandler`] for multiple other `IntoConnectionHandler`s.
|
||||
#[derive(Clone)]
|
||||
pub struct IntoMultiHandler<K, H> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user