Struct rustix_uring::types::IoringCqeFlags
source · pub struct IoringCqeFlags { /* private fields */ }
Expand description
IORING_CQE_F_*
flags for use with io_uring_cqe
.
Implementations§
source§impl IoringCqeFlags
impl IoringCqeFlags
sourcepub const BUFFER: IoringCqeFlags = Self{ bits: sys::IORING_CQE_F_BUFFER as _,}
pub const BUFFER: IoringCqeFlags = Self{ bits: sys::IORING_CQE_F_BUFFER as _,}
IORING_CQE_F_BUFFER
sourcepub const MORE: IoringCqeFlags = Self{ bits: sys::IORING_CQE_F_MORE as _,}
pub const MORE: IoringCqeFlags = Self{ bits: sys::IORING_CQE_F_MORE as _,}
IORING_CQE_F_MORE
sourcepub const SOCK_NONEMPTY: IoringCqeFlags = Self{ bits: sys::IORING_CQE_F_SOCK_NONEMPTY as _,}
pub const SOCK_NONEMPTY: IoringCqeFlags = Self{ bits: sys::IORING_CQE_F_SOCK_NONEMPTY as _,}
IORING_CQE_F_SOCK_NONEMPTY
sourcepub const NOTIF: IoringCqeFlags = Self{ bits: sys::IORING_CQE_F_NOTIF as _,}
pub const NOTIF: IoringCqeFlags = Self{ bits: sys::IORING_CQE_F_NOTIF as _,}
IORING_CQE_F_NOTIF
sourcepub const fn empty() -> IoringCqeFlags
pub const fn empty() -> IoringCqeFlags
Returns an empty set of flags.
sourcepub const fn all() -> IoringCqeFlags
pub const fn all() -> IoringCqeFlags
Returns the set containing all flags.
sourcepub const fn from_bits(bits: u32) -> Option<IoringCqeFlags>
pub const fn from_bits(bits: u32) -> Option<IoringCqeFlags>
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) -> IoringCqeFlags
pub const fn from_bits_truncate(bits: u32) -> IoringCqeFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> IoringCqeFlags
pub const unsafe fn from_bits_unchecked(bits: u32) -> IoringCqeFlags
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
sourcepub const fn intersects(&self, other: IoringCqeFlags) -> bool
pub const fn intersects(&self, other: IoringCqeFlags) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: IoringCqeFlags) -> bool
pub const fn contains(&self, other: IoringCqeFlags) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: IoringCqeFlags)
pub fn insert(&mut self, other: IoringCqeFlags)
Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: IoringCqeFlags)
pub fn remove(&mut self, other: IoringCqeFlags)
Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: IoringCqeFlags)
pub fn toggle(&mut self, other: IoringCqeFlags)
Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: IoringCqeFlags, value: bool)
pub fn set(&mut self, other: IoringCqeFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: IoringCqeFlags) -> IoringCqeFlags
pub const fn intersection(self, other: IoringCqeFlags) -> IoringCqeFlags
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
sourcepub const fn union(self, other: IoringCqeFlags) -> IoringCqeFlags
pub const fn union(self, other: IoringCqeFlags) -> IoringCqeFlags
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
sourcepub const fn difference(self, other: IoringCqeFlags) -> IoringCqeFlags
pub const fn difference(self, other: IoringCqeFlags) -> IoringCqeFlags
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
sourcepub const fn symmetric_difference(self, other: IoringCqeFlags) -> IoringCqeFlags
pub const fn symmetric_difference(self, other: IoringCqeFlags) -> IoringCqeFlags
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
sourcepub const fn complement(self) -> IoringCqeFlags
pub const fn complement(self) -> IoringCqeFlags
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations§
source§impl Binary for IoringCqeFlags
impl Binary for IoringCqeFlags
source§impl BitAnd<IoringCqeFlags> for IoringCqeFlags
impl BitAnd<IoringCqeFlags> for IoringCqeFlags
source§fn bitand(self, other: IoringCqeFlags) -> IoringCqeFlags
fn bitand(self, other: IoringCqeFlags) -> IoringCqeFlags
Returns the intersection between the two sets of flags.
§type Output = IoringCqeFlags
type Output = IoringCqeFlags
&
operator.source§impl BitAndAssign<IoringCqeFlags> for IoringCqeFlags
impl BitAndAssign<IoringCqeFlags> for IoringCqeFlags
source§fn bitand_assign(&mut self, other: IoringCqeFlags)
fn bitand_assign(&mut self, other: IoringCqeFlags)
Disables all flags disabled in the set.
source§impl BitOr<IoringCqeFlags> for IoringCqeFlags
impl BitOr<IoringCqeFlags> for IoringCqeFlags
source§fn bitor(self, other: IoringCqeFlags) -> IoringCqeFlags
fn bitor(self, other: IoringCqeFlags) -> IoringCqeFlags
Returns the union of the two sets of flags.
§type Output = IoringCqeFlags
type Output = IoringCqeFlags
|
operator.source§impl BitOrAssign<IoringCqeFlags> for IoringCqeFlags
impl BitOrAssign<IoringCqeFlags> for IoringCqeFlags
source§fn bitor_assign(&mut self, other: IoringCqeFlags)
fn bitor_assign(&mut self, other: IoringCqeFlags)
Adds the set of flags.
source§impl BitXor<IoringCqeFlags> for IoringCqeFlags
impl BitXor<IoringCqeFlags> for IoringCqeFlags
source§fn bitxor(self, other: IoringCqeFlags) -> IoringCqeFlags
fn bitxor(self, other: IoringCqeFlags) -> IoringCqeFlags
Returns the left flags, but with all the right flags toggled.
§type Output = IoringCqeFlags
type Output = IoringCqeFlags
^
operator.source§impl BitXorAssign<IoringCqeFlags> for IoringCqeFlags
impl BitXorAssign<IoringCqeFlags> for IoringCqeFlags
source§fn bitxor_assign(&mut self, other: IoringCqeFlags)
fn bitxor_assign(&mut self, other: IoringCqeFlags)
Toggles the set of flags.
source§impl Clone for IoringCqeFlags
impl Clone for IoringCqeFlags
source§fn clone(&self) -> IoringCqeFlags
fn clone(&self) -> IoringCqeFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for IoringCqeFlags
impl Debug for IoringCqeFlags
source§impl Default for IoringCqeFlags
impl Default for IoringCqeFlags
source§fn default() -> IoringCqeFlags
fn default() -> IoringCqeFlags
source§impl Extend<IoringCqeFlags> for IoringCqeFlags
impl Extend<IoringCqeFlags> for IoringCqeFlags
source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = IoringCqeFlags>,
fn extend<T>(&mut self, iterator: T)where T: IntoIterator<Item = IoringCqeFlags>,
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<IoringCqeFlags> for IoringCqeFlags
impl FromIterator<IoringCqeFlags> for IoringCqeFlags
source§fn from_iter<T>(iterator: T) -> IoringCqeFlagswhere
T: IntoIterator<Item = IoringCqeFlags>,
fn from_iter<T>(iterator: T) -> IoringCqeFlagswhere T: IntoIterator<Item = IoringCqeFlags>,
source§impl Hash for IoringCqeFlags
impl Hash for IoringCqeFlags
source§impl LowerHex for IoringCqeFlags
impl LowerHex for IoringCqeFlags
source§impl Not for IoringCqeFlags
impl Not for IoringCqeFlags
source§fn not(self) -> IoringCqeFlags
fn not(self) -> IoringCqeFlags
Returns the complement of this set of flags.
§type Output = IoringCqeFlags
type Output = IoringCqeFlags
!
operator.source§impl Octal for IoringCqeFlags
impl Octal for IoringCqeFlags
source§impl Ord for IoringCqeFlags
impl Ord for IoringCqeFlags
source§fn cmp(&self, other: &IoringCqeFlags) -> Ordering
fn cmp(&self, other: &IoringCqeFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<IoringCqeFlags> for IoringCqeFlags
impl PartialEq<IoringCqeFlags> for IoringCqeFlags
source§fn eq(&self, other: &IoringCqeFlags) -> bool
fn eq(&self, other: &IoringCqeFlags) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<IoringCqeFlags> for IoringCqeFlags
impl PartialOrd<IoringCqeFlags> for IoringCqeFlags
source§fn partial_cmp(&self, other: &IoringCqeFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &IoringCqeFlags) -> 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<IoringCqeFlags> for IoringCqeFlags
impl Sub<IoringCqeFlags> for IoringCqeFlags
source§fn sub(self, other: IoringCqeFlags) -> IoringCqeFlags
fn sub(self, other: IoringCqeFlags) -> IoringCqeFlags
Returns the set difference of the two sets of flags.
§type Output = IoringCqeFlags
type Output = IoringCqeFlags
-
operator.source§impl SubAssign<IoringCqeFlags> for IoringCqeFlags
impl SubAssign<IoringCqeFlags> for IoringCqeFlags
source§fn sub_assign(&mut self, other: IoringCqeFlags)
fn sub_assign(&mut self, other: IoringCqeFlags)
Disables all flags enabled in the set.