hickory_proto::udp

Trait DnsUdpSocket

Source
pub trait DnsUdpSocket
where Self: Send + Sync + Sized + Unpin,
{ type Time: Time; // Required methods fn poll_recv_from( &self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<(usize, SocketAddr)>>; fn poll_send_to( &self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr, ) -> Poll<Result<usize>>; // Provided methods fn recv_from<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<(usize, SocketAddr)>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn send_to<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 [u8], target: SocketAddr, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } }
Expand description

Trait for DnsUdpSocket

Required Associated Types§

Source

type Time: Time

Time implementation used for this type

Required Methods§

Source

fn poll_recv_from( &self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<(usize, SocketAddr)>>

Poll once Receive data from the socket and returns the number of bytes read and the address from where the data came on success.

Source

fn poll_send_to( &self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr, ) -> Poll<Result<usize>>

Poll once to send data to the given address.

Provided Methods§

Source

fn recv_from<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<(usize, SocketAddr)>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Receive data from the socket and returns the number of bytes read and the address from where the data came on success.

Source

fn send_to<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 [u8], target: SocketAddr, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send data to the given address.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl DnsUdpSocket for UdpSocket

Available on crate feature tokio-runtime only.
Source§

type Time = TokioTime

Source§

fn poll_recv_from( &self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<(usize, SocketAddr)>>

Source§

fn poll_send_to( &self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr, ) -> Poll<Result<usize>>

Implementors§