pub trait UdpSocketExt: Send + Sync {
// Required 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: '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: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn recv_from_with_metrics<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
metrics: &'life2 Metrics,
) -> Pin<Box<dyn Future<Output = Result<(usize, SocketAddr)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn send_to_with_metrics<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
buf: &'life1 [u8],
target: SocketAddr,
metrics: &'life2 Metrics,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Trait for UDP socket operations with optional dump/replay functionality
Required 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: '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: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
Sourcefn recv_from_with_metrics<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
metrics: &'life2 Metrics,
) -> Pin<Box<dyn Future<Output = Result<(usize, SocketAddr)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn recv_from_with_metrics<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
metrics: &'life2 Metrics,
) -> Pin<Box<dyn Future<Output = Result<(usize, SocketAddr)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Wrapper function that calls recv_from and increments metrics
Sourcefn send_to_with_metrics<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
buf: &'life1 [u8],
target: SocketAddr,
metrics: &'life2 Metrics,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_to_with_metrics<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
buf: &'life1 [u8],
target: SocketAddr,
metrics: &'life2 Metrics,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Wrapper function that calls send_to and increments metrics