pub struct UdpBindFlags { /* private fields */ }
Expand description
Flags to UdpHandle::bind()
Implementations§
source§impl UdpBindFlags
impl UdpBindFlags
sourcepub const IPV6ONLY: UdpBindFlags = _
pub const IPV6ONLY: UdpBindFlags = _
Disables dual stack mode.
sourcepub const REUSEADDR: UdpBindFlags = _
pub const REUSEADDR: UdpBindFlags = _
Indicates if SO_REUSEADDR will be set when binding the handle in bind(). This sets the SO_REUSEPORT socket flag on the BSDs and OS X. On other Unix platforms, it sets the SO_REUSEADDR flag. What that means is that multiple threads or processes can bind to the same address without error (provided they all set the flag) but only the last one to bind will receive any traffic, in effect “stealing” the port from the previous listener.
sourcepub const RECVERR: UdpBindFlags = _
pub const RECVERR: UdpBindFlags = _
Indicates if IP_RECVERR/IPV6_RECVERR will be set when binding the handle. This sets IP_RECVERR for IPv4 and IPV6_RECVERR for IPv6 UDP sockets on Linux. This stops the Linux kernel from suppressing some ICMP error messages and enables full ICMP error reporting for faster failover. This flag is no-op on platforms other than Linux.
sourcepub const fn empty() -> UdpBindFlags
pub const fn empty() -> UdpBindFlags
Returns an empty set of flags
sourcepub const fn all() -> UdpBindFlags
pub const fn all() -> UdpBindFlags
Returns the set containing all flags.
sourcepub fn from_bits(bits: u32) -> Option<UdpBindFlags>
pub fn from_bits(bits: u32) -> Option<UdpBindFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u32) -> UdpBindFlags
pub const fn from_bits_truncate(bits: u32) -> UdpBindFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> UdpBindFlags
pub const unsafe fn from_bits_unchecked(bits: u32) -> UdpBindFlags
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
sourcepub const fn intersects(&self, other: UdpBindFlags) -> bool
pub const fn intersects(&self, other: UdpBindFlags) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: UdpBindFlags) -> bool
pub const fn contains(&self, other: UdpBindFlags) -> bool
Returns true
all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: UdpBindFlags)
pub fn insert(&mut self, other: UdpBindFlags)
Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: UdpBindFlags)
pub fn remove(&mut self, other: UdpBindFlags)
Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: UdpBindFlags)
pub fn toggle(&mut self, other: UdpBindFlags)
Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: UdpBindFlags, value: bool)
pub fn set(&mut self, other: UdpBindFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations§
source§impl Binary for UdpBindFlags
impl Binary for UdpBindFlags
source§impl BitAnd for UdpBindFlags
impl BitAnd for UdpBindFlags
source§fn bitand(self, other: UdpBindFlags) -> UdpBindFlags
fn bitand(self, other: UdpBindFlags) -> UdpBindFlags
Returns the intersection between the two sets of flags.
§type Output = UdpBindFlags
type Output = UdpBindFlags
&
operator.source§impl BitAndAssign for UdpBindFlags
impl BitAndAssign for UdpBindFlags
source§fn bitand_assign(&mut self, other: UdpBindFlags)
fn bitand_assign(&mut self, other: UdpBindFlags)
Disables all flags disabled in the set.
source§impl BitOr for UdpBindFlags
impl BitOr for UdpBindFlags
source§fn bitor(self, other: UdpBindFlags) -> UdpBindFlags
fn bitor(self, other: UdpBindFlags) -> UdpBindFlags
Returns the union of the two sets of flags.
§type Output = UdpBindFlags
type Output = UdpBindFlags
|
operator.source§impl BitOrAssign for UdpBindFlags
impl BitOrAssign for UdpBindFlags
source§fn bitor_assign(&mut self, other: UdpBindFlags)
fn bitor_assign(&mut self, other: UdpBindFlags)
Adds the set of flags.
source§impl BitXor for UdpBindFlags
impl BitXor for UdpBindFlags
source§fn bitxor(self, other: UdpBindFlags) -> UdpBindFlags
fn bitxor(self, other: UdpBindFlags) -> UdpBindFlags
Returns the left flags, but with all the right flags toggled.
§type Output = UdpBindFlags
type Output = UdpBindFlags
^
operator.source§impl BitXorAssign for UdpBindFlags
impl BitXorAssign for UdpBindFlags
source§fn bitxor_assign(&mut self, other: UdpBindFlags)
fn bitxor_assign(&mut self, other: UdpBindFlags)
Toggles the set of flags.
source§impl Clone for UdpBindFlags
impl Clone for UdpBindFlags
source§fn clone(&self) -> UdpBindFlags
fn clone(&self) -> UdpBindFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UdpBindFlags
impl Debug for UdpBindFlags
source§impl Extend<UdpBindFlags> for UdpBindFlags
impl Extend<UdpBindFlags> for UdpBindFlags
source§fn extend<T: IntoIterator<Item = UdpBindFlags>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = UdpBindFlags>>(&mut self, iterator: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl FromIterator<UdpBindFlags> for UdpBindFlags
impl FromIterator<UdpBindFlags> for UdpBindFlags
source§fn from_iter<T: IntoIterator<Item = UdpBindFlags>>(iterator: T) -> UdpBindFlags
fn from_iter<T: IntoIterator<Item = UdpBindFlags>>(iterator: T) -> UdpBindFlags
source§impl Hash for UdpBindFlags
impl Hash for UdpBindFlags
source§impl LowerHex for UdpBindFlags
impl LowerHex for UdpBindFlags
source§impl Not for UdpBindFlags
impl Not for UdpBindFlags
source§fn not(self) -> UdpBindFlags
fn not(self) -> UdpBindFlags
Returns the complement of this set of flags.
§type Output = UdpBindFlags
type Output = UdpBindFlags
!
operator.source§impl Octal for UdpBindFlags
impl Octal for UdpBindFlags
source§impl Ord for UdpBindFlags
impl Ord for UdpBindFlags
source§fn cmp(&self, other: &UdpBindFlags) -> Ordering
fn cmp(&self, other: &UdpBindFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for UdpBindFlags
impl PartialEq for UdpBindFlags
source§fn eq(&self, other: &UdpBindFlags) -> bool
fn eq(&self, other: &UdpBindFlags) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for UdpBindFlags
impl PartialOrd for UdpBindFlags
source§fn partial_cmp(&self, other: &UdpBindFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &UdpBindFlags) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Sub for UdpBindFlags
impl Sub for UdpBindFlags
source§fn sub(self, other: UdpBindFlags) -> UdpBindFlags
fn sub(self, other: UdpBindFlags) -> UdpBindFlags
Returns the set difference of the two sets of flags.
§type Output = UdpBindFlags
type Output = UdpBindFlags
-
operator.source§impl SubAssign for UdpBindFlags
impl SubAssign for UdpBindFlags
source§fn sub_assign(&mut self, other: UdpBindFlags)
fn sub_assign(&mut self, other: UdpBindFlags)
Disables all flags enabled in the set.