mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-17 20:11:22 +00:00
swarm/src/handler: Add impl IntoIterator for MultiHandler (#2572)
This commit is contained in:
@ -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> {
|
||||
|
Reference in New Issue
Block a user