Struct RFlags
#[repr(transparent)]pub struct RFlags(<RFlags as PublicFlags>::Internal);Expand description
The RFLAGS register. All bit patterns are valid representations for this type.
Tuple Fields§
§0: <RFlags as PublicFlags>::InternalImplementations§
§impl RFlags
impl RFlags
pub const ID: RFlags
pub const ID: RFlags
Processor feature identification flag.
If this flag is modifiable, the CPU supports CPUID.
pub const VIRTUAL_INTERRUPT_PENDING: RFlags
pub const VIRTUAL_INTERRUPT_PENDING: RFlags
Indicates that an external, maskable interrupt is pending.
Used when virtual-8086 mode extensions (CR4.VME) or protected-mode virtual interrupts (CR4.PVI) are activated.
pub const VIRTUAL_INTERRUPT: RFlags
pub const VIRTUAL_INTERRUPT: RFlags
Virtual image of the INTERRUPT_FLAG bit.
Used when virtual-8086 mode extensions (CR4.VME) or protected-mode virtual interrupts (CR4.PVI) are activated.
pub const ALIGNMENT_CHECK: RFlags
pub const ALIGNMENT_CHECK: RFlags
Enable automatic alignment checking if CR0.AM is set. Only works if CPL is 3.
pub const VIRTUAL_8086_MODE: RFlags
pub const VIRTUAL_8086_MODE: RFlags
Enable the virtual-8086 mode.
pub const RESUME_FLAG: RFlags
pub const RESUME_FLAG: RFlags
Allows to restart an instruction following an instruction breakpoint.
pub const NESTED_TASK: RFlags
pub const NESTED_TASK: RFlags
Used by iret in hardware task switch mode to determine if current task is nested.
pub const IOPL_HIGH: RFlags
pub const IOPL_HIGH: RFlags
The high bit of the I/O Privilege Level field.
Specifies the privilege level required for executing I/O address-space instructions.
pub const IOPL_LOW: RFlags
pub const IOPL_LOW: RFlags
The low bit of the I/O Privilege Level field.
Specifies the privilege level required for executing I/O address-space instructions.
pub const OVERFLOW_FLAG: RFlags
pub const OVERFLOW_FLAG: RFlags
Set by hardware to indicate that the sign bit of the result of the last signed integer operation differs from the source operands.
pub const DIRECTION_FLAG: RFlags
pub const DIRECTION_FLAG: RFlags
Determines the order in which strings are processed.
pub const INTERRUPT_FLAG: RFlags
pub const INTERRUPT_FLAG: RFlags
Enable interrupts.
pub const SIGN_FLAG: RFlags
pub const SIGN_FLAG: RFlags
Set by hardware if last arithmetic operation resulted in a negative value.
pub const AUXILIARY_CARRY_FLAG: RFlags
pub const AUXILIARY_CARRY_FLAG: RFlags
Set by hardware if last arithmetic operation generated a carry ouf of bit 3 of the result.
pub const PARITY_FLAG: RFlags
pub const PARITY_FLAG: RFlags
Set by hardware if last result has an even number of 1 bits (only for some operations).
pub const CARRY_FLAG: RFlags
pub const CARRY_FLAG: RFlags
Set by hardware if last arithmetic operation generated a carry out of the most-significant bit of the result.
§impl RFlags
impl RFlags
pub const fn bits(&self) -> u64
pub const fn bits(&self) -> u64
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
pub const fn from_bits(bits: u64) -> Option<RFlags>
pub const fn from_bits(bits: u64) -> Option<RFlags>
Convert from a bits value.
This method will return None if any unknown bits are set.
pub const fn from_bits_truncate(bits: u64) -> RFlags
pub const fn from_bits_truncate(bits: u64) -> RFlags
Convert from a bits value, unsetting any unknown bits.
pub const fn from_bits_retain(bits: u64) -> RFlags
pub const fn from_bits_retain(bits: u64) -> RFlags
Convert from a bits value exactly.
pub fn from_name(name: &str) -> Option<RFlags>
pub fn from_name(name: &str) -> Option<RFlags>
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: RFlags) -> bool
pub const fn intersects(&self, other: RFlags) -> bool
Whether any set bits in other are also set in self.
pub const fn contains(&self, other: RFlags) -> bool
pub const fn contains(&self, other: RFlags) -> bool
Whether all set bits in other are also set in self.
pub fn remove(&mut self, other: RFlags)
pub fn remove(&mut self, other: RFlags)
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.
pub fn set(&mut self, other: RFlags, value: bool)
pub fn set(&mut self, other: RFlags, value: bool)
Call insert when value is true or remove when value is false.
pub const fn intersection(self, other: RFlags) -> RFlags
pub const fn intersection(self, other: RFlags) -> RFlags
The bitwise and (&) of the bits in self and other.
pub const fn difference(self, other: RFlags) -> RFlags
pub const fn difference(self, other: RFlags) -> RFlags
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.
pub const fn symmetric_difference(self, other: RFlags) -> RFlags
pub const fn symmetric_difference(self, other: RFlags) -> RFlags
The bitwise exclusive-or (^) of the bits in self and other.
pub const fn complement(self) -> RFlags
pub const fn complement(self) -> RFlags
The bitwise negation (!) of the bits in self, truncating the result.
§impl RFlags
impl RFlags
pub const fn iter(&self) -> Iter<RFlags> ⓘ
pub const fn iter(&self) -> Iter<RFlags> ⓘ
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<RFlags> ⓘ
pub const fn iter_names(&self) -> IterNames<RFlags> ⓘ
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§
§impl BitAndAssign for RFlags
impl BitAndAssign for RFlags
§fn bitand_assign(&mut self, other: RFlags)
fn bitand_assign(&mut self, other: RFlags)
The bitwise and (&) of the bits in self and other.
§impl BitOrAssign for RFlags
impl BitOrAssign for RFlags
§fn bitor_assign(&mut self, other: RFlags)
fn bitor_assign(&mut self, other: RFlags)
The bitwise or (|) of the bits in self and other.
§impl BitXorAssign for RFlags
impl BitXorAssign for RFlags
§fn bitxor_assign(&mut self, other: RFlags)
fn bitxor_assign(&mut self, other: RFlags)
The bitwise exclusive-or (^) of the bits in self and other.
impl Copy for RFlags
impl Eq for RFlags
§impl Extend<RFlags> for RFlags
impl Extend<RFlags> for RFlags
§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = RFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = RFlags>,
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 RFlags
impl Flags for RFlags
§fn from_bits_retain(bits: u64) -> RFlags
fn from_bits_retain(bits: u64) -> RFlags
§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
§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 iter_defined_names() -> IterDefinedNames<Self> ⓘ
fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
Self::FLAGS].§fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§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.§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.§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 self and other.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in self and other.§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in self, truncating the result.§impl FromIterator<RFlags> for RFlags
impl FromIterator<RFlags> for RFlags
§fn from_iter<T>(iterator: T) -> RFlagswhere
T: IntoIterator<Item = RFlags>,
fn from_iter<T>(iterator: T) -> RFlagswhere
T: IntoIterator<Item = RFlags>,
The bitwise or (|) of the bits in each flags value.
§impl IntoIterator for RFlags
impl IntoIterator for RFlags
§impl Ord for RFlags
impl Ord for RFlags
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialOrd for RFlags
impl PartialOrd for RFlags
impl StructuralPartialEq for RFlags
§impl Sub for RFlags
impl Sub for RFlags
Auto Trait Implementations§
impl Freeze for RFlags
impl RefUnwindSafe for RFlags
impl Send for RFlags
impl Sync for RFlags
impl Unpin for RFlags
impl UnsafeUnpin for RFlags
impl UnwindSafe for RFlags
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more