pub struct UdpListener { /* private fields */ }Expand description
Udp packet listener.
Implementations§
Source§impl UdpListener
impl UdpListener
Sourcepub fn new(local_address: SocketAddr) -> Result<Self>
pub fn new(local_address: SocketAddr) -> Result<Self>
Create from a bound udp socket.
Sourcepub async fn accept(
&self,
buf: &mut [u8],
) -> Result<(usize, UdpStreamLocal, SocketAddr)>
pub async fn accept( &self, buf: &mut [u8], ) -> Result<(usize, UdpStreamLocal, SocketAddr)>
Accept a new stream.
On success, it returns peer stream socket, peer address and
the number of bytes read.
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