Skip to main content

DatagramPeekInput

Trait DatagramPeekInput 

pub trait DatagramPeekInput: Send + 'static {
    type Socket: DatagramSocket;
    type Mapped<Peeked: DatagramSocket>: Send + 'static;

    // Required methods
    fn peek_socket_mut(&mut self) -> &mut Self::Socket;
    fn map_peek_socket<Peeked, F>(self, map: F) -> Self::Mapped<Peeked>
       where Peeked: DatagramSocket,
             F: FnOnce(Self::Socket) -> Peeked;
}
Available on crate features std and udp only.
Expand description

An input whose ingress datagrams an inspection may read ahead: a DatagramSocket itself, or the ingress side of a BridgeIo whose egress was already prepared.

Required Associated Types§

type Socket: DatagramSocket

The socket an inspection reads from.

type Mapped<Peeked: DatagramSocket>: Send + 'static

This input with its peeked socket replaced, usually by a PrefixedDatagramSocket.

Required Methods§

fn peek_socket_mut(&mut self) -> &mut Self::Socket

The socket an inspection reads from.

fn map_peek_socket<Peeked, F>(self, map: F) -> Self::Mapped<Peeked>
where Peeked: DatagramSocket, F: FnOnce(Self::Socket) -> Peeked,

Rebuild this input around map’s result for its peeked socket.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl<Ingress, Egress> DatagramPeekInput for BridgeIo<Ingress, Egress>
where Ingress: DatagramSocket, Egress: Send + 'static,

§

type Socket = Ingress

§

type Mapped<Peeked: DatagramSocket> = BridgeIo<Peeked, Egress>

§

impl<S> DatagramPeekInput for S
where S: DatagramSocket,

§

type Socket = S

§

type Mapped<Peeked: DatagramSocket> = Peeked