Struct UdpSocket
pub struct UdpSocket { pub(in ::sys::net::connection::socket) inner: Socket }
Fields
inner: Socket
Implementations
impl UdpSocket
fn bind<A: ToSocketAddrs>(addr: A) -> Result<UdpSocket>fn socket(&self) -> &Socketfn into_socket(self) -> Socketfn peer_addr(&self) -> Result<SocketAddr>fn socket_addr(&self) -> Result<SocketAddr>fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>fn peek_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>fn send_to(&self, buf: &[u8], dst: &SocketAddr) -> Result<usize>fn duplicate(&self) -> Result<UdpSocket>fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>fn read_timeout(&self) -> Result<Option<Duration>>fn write_timeout(&self) -> Result<Option<Duration>>fn set_broadcast(&self, broadcast: bool) -> Result<()>fn broadcast(&self) -> Result<bool>fn set_multicast_loop_v4(&self, multicast_loop_v4: bool) -> Result<()>fn multicast_loop_v4(&self) -> Result<bool>fn set_multicast_ttl_v4(&self, multicast_ttl_v4: u32) -> Result<()>fn multicast_ttl_v4(&self) -> Result<u32>fn set_multicast_loop_v6(&self, multicast_loop_v6: bool) -> Result<()>fn multicast_loop_v6(&self) -> Result<bool>fn join_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> Result<()>fn join_multicast_v6(&self, multiaddr: &Ipv6Addr, interface: u32) -> Result<()>fn leave_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> Result<()>fn leave_multicast_v6(&self, multiaddr: &Ipv6Addr, interface: u32) -> Result<()>fn set_ttl(&self, ttl: u32) -> Result<()>fn ttl(&self) -> Result<u32>fn take_error(&self) -> Result<Option<Error>>fn set_nonblocking(&self, nonblocking: bool) -> Result<()>fn recv(&self, buf: &mut [u8]) -> Result<usize>fn peek(&self, buf: &mut [u8]) -> Result<usize>fn send(&self, buf: &[u8]) -> Result<usize>fn connect<A: ToSocketAddrs>(&self, addr: A) -> Result<()>
Trait Implementations
impl Debug for UdpSocket
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl FromInner<Socket> for UdpSocket
fn from_inner(socket: Socket) -> UdpSocket
Auto Trait Implementations
impl Freeze for UdpSocket
impl RefUnwindSafe for UdpSocket
impl Send for UdpSocket
impl Sync for UdpSocket
impl Unpin for UdpSocket
impl UnsafeUnpin for UdpSocket
impl UnwindSafe for UdpSocket
Blanket Implementations
impl<T> Any for UdpSocket
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for UdpSocket
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for UdpSocket
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for UdpSocket
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for UdpSocket
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for UdpSocket
impl<T, U> Into<U> for UdpSocket
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for UdpSocket
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for UdpSocket
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>