Struct ShutdownMode
pub struct ShutdownMode(/* private fields */);
Expand description
Socket shutdown mode.
Implementations§
§impl ShutdownMode
impl ShutdownMode
pub const READ: ShutdownMode
pub const READ: ShutdownMode
Shutdown socket read endpoint.
pub const WRITE: ShutdownMode
pub const WRITE: ShutdownMode
Shutdown socket write endpoint.
§impl ShutdownMode
impl ShutdownMode
pub const fn empty() -> ShutdownMode
pub const fn empty() -> ShutdownMode
Get a flags value with all bits unset.
pub const fn all() -> ShutdownMode
pub const fn all() -> ShutdownMode
Get a flags value with all known bits set.
pub const fn bits(&self) -> u16
pub const fn bits(&self) -> u16
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
pub const fn from_bits(bits: u16) -> Option<ShutdownMode>
pub const fn from_bits(bits: u16) -> Option<ShutdownMode>
Convert from a bits value.
This method will return None
if any unknown bits are set.
pub const fn from_bits_truncate(bits: u16) -> ShutdownMode
pub const fn from_bits_truncate(bits: u16) -> ShutdownMode
Convert from a bits value, unsetting any unknown bits.
pub const fn from_bits_retain(bits: u16) -> ShutdownMode
pub const fn from_bits_retain(bits: u16) -> ShutdownMode
Convert from a bits value exactly.
pub fn from_name(name: &str) -> Option<ShutdownMode>
pub fn from_name(name: &str) -> Option<ShutdownMode>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
pub const fn intersects(&self, other: ShutdownMode) -> bool
pub const fn intersects(&self, other: ShutdownMode) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
pub const fn contains(&self, other: ShutdownMode) -> bool
pub const fn contains(&self, other: ShutdownMode) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
pub fn insert(&mut self, other: ShutdownMode)
pub fn insert(&mut self, other: ShutdownMode)
The bitwise or (|
) of the bits in two flags values.
pub fn remove(&mut self, other: ShutdownMode)
pub fn remove(&mut self, other: ShutdownMode)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
pub fn toggle(&mut self, other: ShutdownMode)
pub fn toggle(&mut self, other: ShutdownMode)
The bitwise exclusive-or (^
) of the bits in two flags values.
pub fn set(&mut self, other: ShutdownMode, value: bool)
pub fn set(&mut self, other: ShutdownMode, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
pub const fn intersection(self, other: ShutdownMode) -> ShutdownMode
pub const fn intersection(self, other: ShutdownMode) -> ShutdownMode
The bitwise and (&
) of the bits in two flags values.
pub const fn union(self, other: ShutdownMode) -> ShutdownMode
pub const fn union(self, other: ShutdownMode) -> ShutdownMode
The bitwise or (|
) of the bits in two flags values.
pub const fn difference(self, other: ShutdownMode) -> ShutdownMode
pub const fn difference(self, other: ShutdownMode) -> ShutdownMode
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
pub const fn symmetric_difference(self, other: ShutdownMode) -> ShutdownMode
pub const fn symmetric_difference(self, other: ShutdownMode) -> ShutdownMode
The bitwise exclusive-or (^
) of the bits in two flags values.
pub const fn complement(self) -> ShutdownMode
pub const fn complement(self) -> ShutdownMode
The bitwise negation (!
) of the bits in a flags value, truncating the result.
§impl ShutdownMode
impl ShutdownMode
pub const fn iter(&self) -> Iter<ShutdownMode>
pub const fn iter(&self) -> Iter<ShutdownMode>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
pub const fn iter_names(&self) -> IterNames<ShutdownMode>
pub const fn iter_names(&self) -> IterNames<ShutdownMode>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
§impl ShutdownMode
impl ShutdownMode
pub fn has_unknown_bits(&self) -> bool
has_unknown_bits
pub fn get_unknown_bits(&self) -> u16
get_unknown_bits
Trait Implementations§
§impl Binary for ShutdownMode
impl Binary for ShutdownMode
§impl BitAnd for ShutdownMode
impl BitAnd for ShutdownMode
§fn bitand(self, other: ShutdownMode) -> ShutdownMode
fn bitand(self, other: ShutdownMode) -> ShutdownMode
The bitwise and (&
) of the bits in two flags values.
§type Output = ShutdownMode
type Output = ShutdownMode
&
operator.§impl BitAndAssign for ShutdownMode
impl BitAndAssign for ShutdownMode
§fn bitand_assign(&mut self, other: ShutdownMode)
fn bitand_assign(&mut self, other: ShutdownMode)
The bitwise and (&
) of the bits in two flags values.
§impl BitOr for ShutdownMode
impl BitOr for ShutdownMode
§fn bitor(self, other: ShutdownMode) -> ShutdownMode
fn bitor(self, other: ShutdownMode) -> ShutdownMode
The bitwise or (|
) of the bits in two flags values.
§type Output = ShutdownMode
type Output = ShutdownMode
|
operator.§impl BitOrAssign for ShutdownMode
impl BitOrAssign for ShutdownMode
§fn bitor_assign(&mut self, other: ShutdownMode)
fn bitor_assign(&mut self, other: ShutdownMode)
The bitwise or (|
) of the bits in two flags values.
§impl BitXor for ShutdownMode
impl BitXor for ShutdownMode
§fn bitxor(self, other: ShutdownMode) -> ShutdownMode
fn bitxor(self, other: ShutdownMode) -> ShutdownMode
The bitwise exclusive-or (^
) of the bits in two flags values.
§type Output = ShutdownMode
type Output = ShutdownMode
^
operator.§impl BitXorAssign for ShutdownMode
impl BitXorAssign for ShutdownMode
§fn bitxor_assign(&mut self, other: ShutdownMode)
fn bitxor_assign(&mut self, other: ShutdownMode)
The bitwise exclusive-or (^
) of the bits in two flags values.
§impl Clone for ShutdownMode
impl Clone for ShutdownMode
§fn clone(&self) -> ShutdownMode
fn clone(&self) -> ShutdownMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ShutdownMode
impl Debug for ShutdownMode
§impl<D> Decode<ShutdownMode, D> for ShutdownModewhere
D: ResourceDialect,
impl<D> Decode<ShutdownMode, D> for ShutdownModewhere
D: ResourceDialect,
§fn new_empty() -> ShutdownMode
fn new_empty() -> ShutdownMode
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl Default for ShutdownMode
impl Default for ShutdownMode
§fn default() -> ShutdownMode
fn default() -> ShutdownMode
§impl<D> Encode<ShutdownMode, D> for ShutdownModewhere
D: ResourceDialect,
impl<D> Encode<ShutdownMode, D> for ShutdownModewhere
D: ResourceDialect,
§impl Extend<ShutdownMode> for ShutdownMode
impl Extend<ShutdownMode> for ShutdownMode
§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ShutdownMode>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ShutdownMode>,
The bitwise or (|
) of the bits in each flags value.
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
)§impl Flags for ShutdownMode
impl Flags for ShutdownMode
§const FLAGS: &'static [Flag<ShutdownMode>]
const FLAGS: &'static [Flag<ShutdownMode>]
§fn from_bits_retain(bits: u16) -> ShutdownMode
fn from_bits_retain(bits: u16) -> ShutdownMode
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true
if any unknown bits are set.§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read more§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert
] when value
is true
or [Flags::remove
] when value
is false
.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read more§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.§impl FromIterator<ShutdownMode> for ShutdownMode
impl FromIterator<ShutdownMode> for ShutdownMode
§fn from_iter<T>(iterator: T) -> ShutdownModewhere
T: IntoIterator<Item = ShutdownMode>,
fn from_iter<T>(iterator: T) -> ShutdownModewhere
T: IntoIterator<Item = ShutdownMode>,
The bitwise or (|
) of the bits in each flags value.
§impl Hash for ShutdownMode
impl Hash for ShutdownMode
§impl IntoIterator for ShutdownMode
impl IntoIterator for ShutdownMode
§type Item = ShutdownMode
type Item = ShutdownMode
§type IntoIter = Iter<ShutdownMode>
type IntoIter = Iter<ShutdownMode>
§fn into_iter(self) -> <ShutdownMode as IntoIterator>::IntoIter
fn into_iter(self) -> <ShutdownMode as IntoIterator>::IntoIter
§impl LowerHex for ShutdownMode
impl LowerHex for ShutdownMode
§impl Not for ShutdownMode
impl Not for ShutdownMode
§fn not(self) -> ShutdownMode
fn not(self) -> ShutdownMode
The bitwise negation (!
) of the bits in a flags value, truncating the result.
§type Output = ShutdownMode
type Output = ShutdownMode
!
operator.§impl Octal for ShutdownMode
impl Octal for ShutdownMode
§impl Ord for ShutdownMode
impl Ord for ShutdownMode
§impl PartialEq for ShutdownMode
impl PartialEq for ShutdownMode
§impl PartialOrd for ShutdownMode
impl PartialOrd for ShutdownMode
§impl Sub for ShutdownMode
impl Sub for ShutdownMode
§fn sub(self, other: ShutdownMode) -> ShutdownMode
fn sub(self, other: ShutdownMode) -> ShutdownMode
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
§type Output = ShutdownMode
type Output = ShutdownMode
-
operator.§impl SubAssign for ShutdownMode
impl SubAssign for ShutdownMode
§fn sub_assign(&mut self, other: ShutdownMode)
fn sub_assign(&mut self, other: ShutdownMode)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
§impl TypeMarker for ShutdownMode
impl TypeMarker for ShutdownMode
§type Owned = ShutdownMode
type Owned = ShutdownMode
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl UpperHex for ShutdownMode
impl UpperHex for ShutdownMode
§impl ValueTypeMarker for ShutdownMode
impl ValueTypeMarker for ShutdownMode
§type Borrowed<'a> = ShutdownMode
type Borrowed<'a> = ShutdownMode
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<ShutdownMode as TypeMarker>::Owned,
) -> <ShutdownMode as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<ShutdownMode as TypeMarker>::Owned, ) -> <ShutdownMode as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.