pub struct UdpSocket { /* private fields */ }
Expand description
Tokio-compatible UDP socket with some useful specializations.
Unlike a standard tokio UDP socket, this allows ECN bits to be read and written on some platforms.
Implementations
sourceimpl UdpSocket
impl UdpSocket
pub fn from_std(socket: UdpSocket) -> Result<UdpSocket>
pub fn poll_send(
&mut self,
state: &UdpState,
cx: &mut Context<'_>,
transmits: &[Transmit]
) -> Poll<Result<usize, Error>>
pub fn poll_recv(
&self,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>],
meta: &mut [RecvMeta]
) -> Poll<Result<usize>>
pub fn local_addr(&self) -> Result<SocketAddr>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for UdpSocket
impl Send for UdpSocket
impl Sync for UdpSocket
impl Unpin for UdpSocket
impl !UnwindSafe for UdpSocket
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more