pub struct UdpSocket { /* private fields */ }
Implementations§
source§impl UdpSocket
impl UdpSocket
pub fn bind<A: ToSocketAddrs>(addr: A) -> Result<UdpSocket>
pub fn from_std(socket: UdpSocket) -> Result<UdpSocket>
pub fn local_addr(&self) -> Result<SocketAddr>
pub fn connect<A: ToSocketAddrs>(&self, addr: A) -> Result<()>
pub async fn recv(&self, buf: &mut [u8]) -> Result<usize>
pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub async fn send(&self, buf: &[u8]) -> Result<usize>
pub async fn send_to<A: Into<SocketAddr>>( &self, buf: &[u8], target: A ) -> Result<usize>
pub fn poll_recv(&self, cx: &Context<'_>, buf: &mut [u8]) -> Poll<Result<usize>>
pub fn poll_recv_from( &self, cx: &Context<'_>, buf: &mut [u8] ) -> Poll<Result<(usize, SocketAddr)>>
pub fn poll_send(&self, cx: &Context<'_>, buf: &[u8]) -> Poll<Result<usize>>
pub fn poll_send_to<A: Into<SocketAddr>>( &self, cx: &Context<'_>, buf: &[u8], target: A ) -> Poll<Result<usize>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UdpSocket
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