Struct unix_udp_sock::UdpSocket
source · [−]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 async fn bind<A: ToSocketAddrs>(addrs: A) -> Result<UdpSocket>
pub fn set_broadcast(&self, broadcast: bool) -> Result<()>
pub async fn connect<A: ToSocketAddrs>(&self, addrs: A) -> Result<()>
pub async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result<usize>
pub async fn poll_send_to(&self, buf: &[u8], target: SocketAddr) -> Result<usize>
pub async fn send(&self, buf: &[u8]) -> Result<usize>
pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub fn poll_recv_from(
&self,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>
) -> Poll<Result<SocketAddr>>
pub async fn recv(&self, buf: &mut [u8]) -> Result<usize>
pub async fn send_mmsg<B: AsPtr<u8>>(
&mut self,
state: &UdpState,
transmits: &[Transmit<B>]
) -> Result<usize, Error>
pub async fn send_msg<B: AsPtr<u8>>(
&self,
state: &UdpState,
transmits: Transmit<B>
) -> Result<usize>
pub async fn recv_mmsg(
&self,
bufs: &mut [IoSliceMut<'_>],
meta: &mut [RecvMeta]
) -> Result<usize>
pub async fn recv_msg(
&self,
buf: &mut IoSliceMut<'_>,
meta: &mut RecvMeta
) -> Result<usize>
pub fn poll_send_mmsg<B: AsPtr<u8>>(
&mut self,
state: &UdpState,
cx: &mut Context<'_>,
transmits: &[Transmit<B>]
) -> Poll<Result<usize>>
pub fn poll_send_msg<B: AsPtr<u8>>(
&self,
state: &UdpState,
cx: &mut Context<'_>,
transmits: Transmit<B>
) -> Poll<Result<usize>>
pub fn poll_recv_msg(
&self,
cx: &mut Context<'_>,
buf: &mut IoSliceMut<'_>,
meta: &mut RecvMeta
) -> Poll<Result<usize>>
pub fn poll_recv_mmsg(
&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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more