pub struct UdpSocket {
socket: UdpSocket,
}
Available on (crate features
native-tls
or rustls
) and (crate features async-std
or tokio
) and crate feature tokio
only.Expand description
Wrap a Tokio UdpSocket
Fields§
§socket: UdpSocket
The underelying UdpSocket
Implementations§
Trait Implementations§
Source§impl UdpSocket for UdpSocket
impl UdpSocket for UdpSocket
Source§fn recv<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = IoResult<(usize, SocketAddr)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn recv<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = IoResult<(usize, SocketAddr)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Wait for an incoming datagram; return it along its address.
Source§fn send<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
buf: &'life1 [u8],
target: &'life2 SocketAddr,
) -> Pin<Box<dyn Future<Output = IoResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
buf: &'life1 [u8],
target: &'life2 SocketAddr,
) -> Pin<Box<dyn Future<Output = IoResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send a datagram to the provided address.
Source§fn local_addr(&self) -> IoResult<SocketAddr>
fn local_addr(&self) -> IoResult<SocketAddr>
Return the local address that this socket is bound to.
Auto Trait Implementations§
impl !Freeze for UdpSocket
impl RefUnwindSafe for UdpSocket
impl Send for UdpSocket
impl Sync for UdpSocket
impl Unpin for UdpSocket
impl UnwindSafe for UdpSocket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more