1
2
3
4
5
6
7
8
9
10
11
12
use crate::Packet;

/// This trait is used to implement Stream and Iterator feature.
/// This is almost like `map()`.
///
// This is needed cause we don't have GaTs
// Once GaTs are stable we could use them to implement better Iterator
pub trait PacketCodec {
    type Item;

    fn decode(&mut self, packet: Packet) -> Self::Item;
}