Struct std::sys_common::net::UdpSocket
source · pub struct UdpSocket {
inner: Socket,
}
Fields§
§inner: Socket
Implementations§
source§impl UdpSocket
impl UdpSocket
pub fn bind(addr: Result<&SocketAddr>) -> Result<UdpSocket>
pub fn socket(&self) -> &Socket
pub fn into_socket(self) -> Socket
pub fn peer_addr(&self) -> Result<SocketAddr>
pub fn socket_addr(&self) -> Result<SocketAddr>
pub fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub fn peek_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub fn send_to(&self, buf: &[u8], dst: &SocketAddr) -> Result<usize>
pub fn duplicate(&self) -> Result<UdpSocket>
pub fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
pub fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
pub fn read_timeout(&self) -> Result<Option<Duration>>
pub fn write_timeout(&self) -> Result<Option<Duration>>
pub fn set_broadcast(&self, broadcast: bool) -> Result<()>
pub fn broadcast(&self) -> Result<bool>
pub fn set_multicast_loop_v4(&self, multicast_loop_v4: bool) -> Result<()>
pub fn multicast_loop_v4(&self) -> Result<bool>
pub fn set_multicast_ttl_v4(&self, multicast_ttl_v4: u32) -> Result<()>
pub fn multicast_ttl_v4(&self) -> Result<u32>
pub fn set_multicast_loop_v6(&self, multicast_loop_v6: bool) -> Result<()>
pub fn multicast_loop_v6(&self) -> Result<bool>
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 set_ttl(&self, ttl: u32) -> Result<()>
pub fn ttl(&self) -> Result<u32>
pub fn take_error(&self) -> Result<Option<Error>>
pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
pub fn recv(&self, buf: &mut [u8]) -> Result<usize>
pub fn peek(&self, buf: &mut [u8]) -> Result<usize>
pub fn send(&self, buf: &[u8]) -> Result<usize>
pub fn connect(&self, addr: Result<&SocketAddr>) -> Result<()>
Trait Implementations§
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