pub struct SocketRights(/* private fields */);Expand description
Socket rights. Overnet treats rights as per-object type, to reduce the space of things that can be communicated over its wire format. Transfer rights are always assumed present.
Implementations§
Source§impl SocketRights
impl SocketRights
pub const READ: SocketRights
pub const WRITE: SocketRights
Source§impl SocketRights
impl SocketRights
Sourcepub const fn empty() -> SocketRights
pub const fn empty() -> SocketRights
Get a flags value with all bits unset.
Sourcepub const fn all() -> SocketRights
pub const fn all() -> SocketRights
Get a flags value with all known bits set.
Sourcepub const fn bits(&self) -> u32
pub const fn bits(&self) -> u32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u32) -> Option<SocketRights>
pub const fn from_bits(bits: u32) -> Option<SocketRights>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u32) -> SocketRights
pub const fn from_bits_truncate(bits: u32) -> SocketRights
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u32) -> SocketRights
pub const fn from_bits_retain(bits: u32) -> SocketRights
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<SocketRights>
pub fn from_name(name: &str) -> Option<SocketRights>
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.
Sourcepub const fn intersects(&self, other: SocketRights) -> bool
pub const fn intersects(&self, other: SocketRights) -> bool
Whether any set bits in other are also set in self.
Sourcepub const fn contains(&self, other: SocketRights) -> bool
pub const fn contains(&self, other: SocketRights) -> bool
Whether all set bits in other are also set in self.
Sourcepub fn insert(&mut self, other: SocketRights)
pub fn insert(&mut self, other: SocketRights)
The bitwise or (|) of the bits in self and other.
Sourcepub fn remove(&mut self, other: SocketRights)
pub fn remove(&mut self, other: SocketRights)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
Sourcepub fn toggle(&mut self, other: SocketRights)
pub fn toggle(&mut self, other: SocketRights)
The bitwise exclusive-or (^) of the bits in self and other.
Sourcepub fn set(&mut self, other: SocketRights, value: bool)
pub fn set(&mut self, other: SocketRights, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: SocketRights) -> SocketRights
pub const fn intersection(self, other: SocketRights) -> SocketRights
The bitwise and (&) of the bits in self and other.
Sourcepub const fn union(self, other: SocketRights) -> SocketRights
pub const fn union(self, other: SocketRights) -> SocketRights
The bitwise or (|) of the bits in self and other.
Sourcepub const fn difference(self, other: SocketRights) -> SocketRights
pub const fn difference(self, other: SocketRights) -> SocketRights
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Sourcepub const fn symmetric_difference(self, other: SocketRights) -> SocketRights
pub const fn symmetric_difference(self, other: SocketRights) -> SocketRights
The bitwise exclusive-or (^) of the bits in self and other.
Sourcepub const fn complement(self) -> SocketRights
pub const fn complement(self) -> SocketRights
The bitwise negation (!) of the bits in self, truncating the result.
Source§impl SocketRights
impl SocketRights
Sourcepub const fn iter(&self) -> Iter<SocketRights> ⓘ
pub const fn iter(&self) -> Iter<SocketRights> ⓘ
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.
Sourcepub const fn iter_names(&self) -> IterNames<SocketRights> ⓘ
pub const fn iter_names(&self) -> IterNames<SocketRights> ⓘ
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.
Trait Implementations§
Source§impl Binary for SocketRights
impl Binary for SocketRights
Source§impl BitAnd for SocketRights
impl BitAnd for SocketRights
Source§fn bitand(self, other: SocketRights) -> SocketRights
fn bitand(self, other: SocketRights) -> SocketRights
The bitwise and (&) of the bits in self and other.
Source§type Output = SocketRights
type Output = SocketRights
& operator.Source§impl BitAndAssign for SocketRights
impl BitAndAssign for SocketRights
Source§fn bitand_assign(&mut self, other: SocketRights)
fn bitand_assign(&mut self, other: SocketRights)
The bitwise and (&) of the bits in self and other.
Source§impl BitOr for SocketRights
impl BitOr for SocketRights
Source§fn bitor(self, other: SocketRights) -> SocketRights
fn bitor(self, other: SocketRights) -> SocketRights
The bitwise or (|) of the bits in self and other.
Source§type Output = SocketRights
type Output = SocketRights
| operator.Source§impl BitOrAssign for SocketRights
impl BitOrAssign for SocketRights
Source§fn bitor_assign(&mut self, other: SocketRights)
fn bitor_assign(&mut self, other: SocketRights)
The bitwise or (|) of the bits in self and other.
Source§impl BitXor for SocketRights
impl BitXor for SocketRights
Source§fn bitxor(self, other: SocketRights) -> SocketRights
fn bitxor(self, other: SocketRights) -> SocketRights
The bitwise exclusive-or (^) of the bits in self and other.
Source§type Output = SocketRights
type Output = SocketRights
^ operator.Source§impl BitXorAssign for SocketRights
impl BitXorAssign for SocketRights
Source§fn bitxor_assign(&mut self, other: SocketRights)
fn bitxor_assign(&mut self, other: SocketRights)
The bitwise exclusive-or (^) of the bits in self and other.
Source§impl Clone for SocketRights
impl Clone for SocketRights
Source§fn clone(&self) -> SocketRights
fn clone(&self) -> SocketRights
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SocketRights
Source§impl Debug for SocketRights
impl Debug for SocketRights
Source§impl<D> Decode<SocketRights, D> for SocketRightswhere
D: ResourceDialect,
impl<D> Decode<SocketRights, D> for SocketRightswhere
D: ResourceDialect,
Source§fn new_empty() -> SocketRights
fn new_empty() -> SocketRights
Self. The specific value does not matter,
since it will be overwritten by decode.Source§impl Default for SocketRights
impl Default for SocketRights
Source§fn default() -> SocketRights
fn default() -> SocketRights
Source§impl<D> Encode<SocketRights, D> for SocketRightswhere
D: ResourceDialect,
impl<D> Encode<SocketRights, D> for SocketRightswhere
D: ResourceDialect,
impl Eq for SocketRights
Source§impl Extend<SocketRights> for SocketRights
impl Extend<SocketRights> for SocketRights
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = SocketRights>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = SocketRights>,
The bitwise or (|) of the bits in each flags value.
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl Flags for SocketRights
impl Flags for SocketRights
Source§const FLAGS: &'static [Flag<SocketRights>]
const FLAGS: &'static [Flag<SocketRights>]
Source§fn from_bits_retain(bits: u32) -> SocketRights
fn from_bits_retain(bits: u32) -> SocketRights
Source§fn all_named() -> SocketRights
fn all_named() -> SocketRights
Source§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
Source§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
Source§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self> ⓘ
fn iter_names(&self) -> IterNames<Self> ⓘ
Source§fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
Self::FLAGS.Source§fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in self and other.Source§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in self and other.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in self and other.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
Source§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in self and other.Source§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in self, truncating the result.Source§impl FromIterator<SocketRights> for SocketRights
impl FromIterator<SocketRights> for SocketRights
Source§fn from_iter<T>(iterator: T) -> SocketRightswhere
T: IntoIterator<Item = SocketRights>,
fn from_iter<T>(iterator: T) -> SocketRightswhere
T: IntoIterator<Item = SocketRights>,
The bitwise or (|) of the bits in each flags value.
Source§impl Hash for SocketRights
impl Hash for SocketRights
Source§impl IntoIterator for SocketRights
impl IntoIterator for SocketRights
Source§type Item = SocketRights
type Item = SocketRights
Source§type IntoIter = Iter<SocketRights>
type IntoIter = Iter<SocketRights>
Source§fn into_iter(self) -> <SocketRights as IntoIterator>::IntoIter
fn into_iter(self) -> <SocketRights as IntoIterator>::IntoIter
Source§impl LowerHex for SocketRights
impl LowerHex for SocketRights
Source§impl Not for SocketRights
impl Not for SocketRights
Source§fn not(self) -> SocketRights
fn not(self) -> SocketRights
The bitwise negation (!) of the bits in self, truncating the result.
Source§type Output = SocketRights
type Output = SocketRights
! operator.Source§impl Octal for SocketRights
impl Octal for SocketRights
Source§impl Ord for SocketRights
impl Ord for SocketRights
Source§fn cmp(&self, other: &SocketRights) -> Ordering
fn cmp(&self, other: &SocketRights) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SocketRights
impl PartialEq for SocketRights
Source§impl PartialOrd for SocketRights
impl PartialOrd for SocketRights
impl StructuralPartialEq for SocketRights
Source§impl Sub for SocketRights
impl Sub for SocketRights
Source§fn sub(self, other: SocketRights) -> SocketRights
fn sub(self, other: SocketRights) -> SocketRights
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Source§type Output = SocketRights
type Output = SocketRights
- operator.Source§impl SubAssign for SocketRights
impl SubAssign for SocketRights
Source§fn sub_assign(&mut self, other: SocketRights)
fn sub_assign(&mut self, other: SocketRights)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Source§impl TypeMarker for SocketRights
impl TypeMarker for SocketRights
Source§type Owned = SocketRights
type Owned = SocketRights
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align.Source§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 moreSource§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.Source§impl UpperHex for SocketRights
impl UpperHex for SocketRights
Source§impl ValueTypeMarker for SocketRights
impl ValueTypeMarker for SocketRights
Source§type Borrowed<'a> = SocketRights
type Borrowed<'a> = SocketRights
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read moreSource§fn borrow(
value: &<SocketRights as TypeMarker>::Owned,
) -> <SocketRights as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<SocketRights as TypeMarker>::Owned, ) -> <SocketRights as ValueTypeMarker>::Borrowed<'_>
&Self::Owned to Self::Borrowed.