Trait dnscache::Network
[−]
[src]
pub trait Network { type ClientId: Copy; fn send_to_client(
&self,
buf: &[u8],
client: Self::ClientId
) -> BoxResult<()>; fn send_to_upstream(&self, buf: &[u8]) -> BoxResult<()>; fn recv_from(
&self,
buf: &mut [u8]
) -> BoxResult<(usize, ReceiveResult<Self::ClientId>)>; }
Network abstraction
Associated Types
Required Methods
fn send_to_client(&self, buf: &[u8], client: Self::ClientId) -> BoxResult<()>
Like UdpSocket::send_to to upstream
fn send_to_upstream(&self, buf: &[u8]) -> BoxResult<()>
Like UdpSocket::send_to
fn recv_from(
&self,
buf: &mut [u8]
) -> BoxResult<(usize, ReceiveResult<Self::ClientId>)>
&self,
buf: &mut [u8]
) -> BoxResult<(usize, ReceiveResult<Self::ClientId>)>
Like UdpSocket::recv_from