Trait PeekIoProvider
pub trait PeekIoProvider: Send + 'static {
type PeekIo: Io;
type PeekEgressIo: Io;
type Mapped<PeekedIo: Io, PeekedEgressIo: Io>: Send + 'static;
// Required methods
fn peek_ios_mut(
&mut self,
) -> (&mut Self::PeekIo, Option<&mut Self::PeekEgressIo>);
fn map_peek_io<PeekedIo, PeekedEgressIo, F, G>(
self,
map: F,
map_egress: G,
) -> Self::Mapped<PeekedIo, PeekedEgressIo>
where PeekedIo: Io,
PeekedEgressIo: Io,
F: FnOnce(Self::PeekIo) -> PeekedIo,
G: FnOnce(Self::PeekEgressIo) -> PeekedEgressIo;
}std only.Expand description
A higher level trait that can be used by services which wish to peek into I/O, often as part of Deep Protocol Inspections (DPI).
It is implemented for any Io, returning itself as ingress and
reporting no egress. BridgeIo also implements it, exposing its first
element as the ingress and its second element as the egress.
Required Associated Types§
type PeekEgressIo: Io
type PeekEgressIo: Io
The egress type that can be peeked, NoPeekEgress when there is none.
Required Methods§
fn peek_ios_mut(
&mut self,
) -> (&mut Self::PeekIo, Option<&mut Self::PeekEgressIo>)
fn peek_ios_mut( &mut self, ) -> (&mut Self::PeekIo, Option<&mut Self::PeekEgressIo>)
Retrieve mutable references to the peekable ingress and, if there is one, the peekable egress.
fn map_peek_io<PeekedIo, PeekedEgressIo, F, G>(
self,
map: F,
map_egress: G,
) -> Self::Mapped<PeekedIo, PeekedEgressIo>
fn map_peek_io<PeekedIo, PeekedEgressIo, F, G>( self, map: F, map_egress: G, ) -> Self::Mapped<PeekedIo, PeekedEgressIo>
Once peeking is finished one can reproduce self
by mapping the peeked ingress and egress, usually with the
peeked data in-memory as prefix.
map_egress is only called when there is an egress.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".