Struct tokio_smoltcp::UdpSocket
source · pub struct UdpSocket { /* private fields */ }
Expand description
A UDP socket.
Implementations§
source§impl UdpSocket
impl UdpSocket
sourcepub fn poll_send_to(
&self,
cx: &mut Context<'_>,
buf: &[u8],
target: SocketAddr
) -> Poll<Result<usize>>
pub fn poll_send_to( &self, cx: &mut Context<'_>, buf: &[u8], target: SocketAddr ) -> Poll<Result<usize>>
Note that on multiple calls to a poll_* method in the send direction, only the Waker from the Context passed to the most recent call will be scheduled to receive a wakeup.
sourcepub async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result<usize>
pub async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result<usize>
See note on poll_send_to
sourcepub fn poll_recv_from(
&self,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<(usize, SocketAddr)>>
pub fn poll_recv_from( &self, cx: &mut Context<'_>, buf: &mut [u8] ) -> Poll<Result<(usize, SocketAddr)>>
Note that on multiple calls to a poll_* method in the recv direction, only the Waker from the Context passed to the most recent call will be scheduled to receive a wakeup.
sourcepub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
See note on poll_recv_from
pub fn local_addr(&self) -> Result<SocketAddr>
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§
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