pub struct UdpSocket {
inner: Socket,
}Fields§
§inner: SocketImplementations§
Source§impl UdpSocket
impl UdpSocket
pub fn bind<A: ToSocketAddrs>(addr: A) -> 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 set_hop_limit_v6(&self, limit: u8) -> Result<()>
pub fn hop_limit_v6(&self) -> Result<u8>
pub fn set_multicast_hop_limit_v6(&self, limit: u8) -> Result<()>
pub fn multicast_hop_limit_v6(&self) -> Result<u8>
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<A: ToSocketAddrs>(&self, addr: A) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Forget for UdpSocket
impl Freeze for UdpSocketwhere
I32NotAllOnes: Freeze,
impl Move for UdpSocket
impl RefUnwindSafe for UdpSocketwhere
I32NotAllOnes: RefUnwindSafe,
impl Send for UdpSocketwhere
I32NotAllOnes: Send,
impl Sync for UdpSocketwhere
I32NotAllOnes: Sync,
impl Unpin for UdpSocketwhere
I32NotAllOnes: Unpin,
impl UnsafeUnpin for UdpSocketwhere
I32NotAllOnes: UnsafeUnpin,
impl UnwindSafe for UdpSocketwhere
I32NotAllOnes: UnwindSafe,
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
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
🔬This is a nightly-only experimental API. (
core_io_internals)Returns a lower bound on the number of elements this container-like item
contains.
For example, an array
[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize
#[doc(hidden)]const SIZE: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize
#[doc(hidden)]const ALIGN: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment
#[doc(hidden)]const ALIGNMENT: Alignment
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const IS_ZST: bool
#[doc(hidden)]const IS_ZST: bool
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout
#[doc(hidden)]const LAYOUT: Layout
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize
#[doc(hidden)]const MAX_SLICE_LEN: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read more