pub struct UdpListener { /* private fields */ }
Expand description
Udp packet listener.
Implementations§
Source§impl UdpListener
impl UdpListener
Sourcepub async fn accept(
&self,
buf: &mut [u8],
) -> Result<(UdpStreamLocal, SocketAddr)>
pub async fn accept( &self, buf: &mut [u8], ) -> Result<(UdpStreamLocal, SocketAddr)>
Accept a new stream.
A listener must be continuously polled to recv packets or accept new streams.
When receiving a packet from a known peer, this function does not return,
and the packet will be copied then sent to the associated
UdpStreamLocal
.
Auto Trait Implementations§
impl Freeze for UdpListener
impl RefUnwindSafe for UdpListener
impl Send for UdpListener
impl Sync for UdpListener
impl Unpin for UdpListener
impl UnwindSafe for UdpListener
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