pub struct UdpSocket(/* private fields */);
Implementations§
Source§impl UdpSocket
impl UdpSocket
pub async fn bind(addr: impl ToSocketAddrs) -> Result<UdpSocket>
pub fn broadcast(&self) -> Result<bool>
pub async fn connect(&self, addr: impl ToSocketAddrs) -> Result<()>
pub fn join_multicast_v4( &self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr, ) -> Result<()>
pub fn join_multicast_v6( &self, multiaddr: &Ipv6Addr, interface: u32, ) -> Result<()>
pub fn leave_multicast_v4( &self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr, ) -> Result<()>
pub fn leave_multicast_v6( &self, multiaddr: &Ipv6Addr, interface: u32, ) -> Result<()>
pub fn local_addr(&self) -> Result<SocketAddr>
pub fn multicast_loop_v4(&self) -> Result<bool>
pub fn multicast_loop_v6(&self) -> Result<bool>
pub fn multicast_ttl_v4(&self) -> Result<u32>
pub async fn peek_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub fn peer_addr(&self) -> Result<SocketAddr>
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( &self, buf: &[u8], target: impl ToSocketAddrs, ) -> Result<usize>
pub fn set_broadcast(&self, on: bool) -> Result<()>
pub fn set_multicast_loop_v4(&self, on: bool) -> Result<()>
pub fn set_multicast_loop_v6(&self, on: bool) -> Result<()>
pub fn set_multicast_ttl_v4(&self, ttl: u32) -> Result<()>
pub fn set_ttl(&self, ttl: u32) -> Result<()>
pub fn ttl(&self) -> Result<u32>
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