pub struct ReadFormat(/* private fields */);Expand description
Flags that control what data is returned when reading from a perf_event file descriptor.
See the man page for the authoritative documentation on what these flags do.
Implementations§
Source§impl ReadFormat
impl ReadFormat
Sourcepub const TOTAL_TIME_ENABLED: ReadFormat
pub const TOTAL_TIME_ENABLED: ReadFormat
Emit the total amount of time the counter has spent enabled.
Sourcepub const TOTAL_TIME_RUNNING: ReadFormat
pub const TOTAL_TIME_RUNNING: ReadFormat
Emit the total amount of time the counter was actually on the CPU.
Sourcepub const ID: ReadFormat
pub const ID: ReadFormat
Emit the counter ID.
Sourcepub const GROUP: ReadFormat
pub const GROUP: ReadFormat
If in a group, read all the counters in the group at once.
Sourcepub const LOST: ReadFormat
pub const LOST: ReadFormat
Emit the number of lost samples for this event.
Source§impl ReadFormat
impl ReadFormat
Sourcepub const fn empty() -> ReadFormat
pub const fn empty() -> ReadFormat
Get a flags value with all bits unset.
Sourcepub const fn all() -> ReadFormat
pub const fn all() -> ReadFormat
Get a flags value with all known bits set.
Sourcepub 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.
Sourcepub const fn from_bits(bits: u64) -> Option<ReadFormat>
pub const fn from_bits(bits: u64) -> Option<ReadFormat>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u64) -> ReadFormat
pub const fn from_bits_truncate(bits: u64) -> ReadFormat
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u64) -> ReadFormat
pub const fn from_bits_retain(bits: u64) -> ReadFormat
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<ReadFormat>
pub fn from_name(name: &str) -> Option<ReadFormat>
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: ReadFormat) -> bool
pub const fn intersects(&self, other: ReadFormat) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: ReadFormat) -> bool
pub const fn contains(&self, other: ReadFormat) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn insert(&mut self, other: ReadFormat)
pub fn insert(&mut self, other: ReadFormat)
The bitwise or (|) of the bits in two flags values.
Sourcepub fn remove(&mut self, other: ReadFormat)
pub fn remove(&mut self, other: ReadFormat)
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.
Sourcepub fn toggle(&mut self, other: ReadFormat)
pub fn toggle(&mut self, other: ReadFormat)
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub fn set(&mut self, other: ReadFormat, value: bool)
pub fn set(&mut self, other: ReadFormat, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: ReadFormat) -> ReadFormat
pub const fn intersection(self, other: ReadFormat) -> ReadFormat
The bitwise and (&) of the bits in two flags values.
Sourcepub const fn union(self, other: ReadFormat) -> ReadFormat
pub const fn union(self, other: ReadFormat) -> ReadFormat
The bitwise or (|) of the bits in two flags values.
Sourcepub const fn difference(self, other: ReadFormat) -> ReadFormat
pub const fn difference(self, other: ReadFormat) -> ReadFormat
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.
Sourcepub const fn symmetric_difference(self, other: ReadFormat) -> ReadFormat
pub const fn symmetric_difference(self, other: ReadFormat) -> ReadFormat
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub const fn complement(self) -> ReadFormat
pub const fn complement(self) -> ReadFormat
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§impl ReadFormat
impl ReadFormat
Sourcepub const fn iter(&self) -> Iter<ReadFormat> ⓘ
pub const fn iter(&self) -> Iter<ReadFormat> ⓘ
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<ReadFormat> ⓘ
pub const fn iter_names(&self) -> IterNames<ReadFormat> ⓘ
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 ReadFormat
impl Binary for ReadFormat
Source§impl BitAnd for ReadFormat
impl BitAnd for ReadFormat
Source§fn bitand(self, other: ReadFormat) -> ReadFormat
fn bitand(self, other: ReadFormat) -> ReadFormat
The bitwise and (&) of the bits in two flags values.
Source§type Output = ReadFormat
type Output = ReadFormat
& operator.Source§impl BitAndAssign for ReadFormat
impl BitAndAssign for ReadFormat
Source§fn bitand_assign(&mut self, other: ReadFormat)
fn bitand_assign(&mut self, other: ReadFormat)
The bitwise and (&) of the bits in two flags values.
Source§impl BitOr for ReadFormat
impl BitOr for ReadFormat
Source§fn bitor(self, other: ReadFormat) -> ReadFormat
fn bitor(self, other: ReadFormat) -> ReadFormat
The bitwise or (|) of the bits in two flags values.
Source§type Output = ReadFormat
type Output = ReadFormat
| operator.Source§impl BitOrAssign for ReadFormat
impl BitOrAssign for ReadFormat
Source§fn bitor_assign(&mut self, other: ReadFormat)
fn bitor_assign(&mut self, other: ReadFormat)
The bitwise or (|) of the bits in two flags values.
Source§impl BitXor for ReadFormat
impl BitXor for ReadFormat
Source§fn bitxor(self, other: ReadFormat) -> ReadFormat
fn bitxor(self, other: ReadFormat) -> ReadFormat
The bitwise exclusive-or (^) of the bits in two flags values.
Source§type Output = ReadFormat
type Output = ReadFormat
^ operator.Source§impl BitXorAssign for ReadFormat
impl BitXorAssign for ReadFormat
Source§fn bitxor_assign(&mut self, other: ReadFormat)
fn bitxor_assign(&mut self, other: ReadFormat)
The bitwise exclusive-or (^) of the bits in two flags values.
Source§impl Clone for ReadFormat
impl Clone for ReadFormat
Source§fn clone(&self) -> ReadFormat
fn clone(&self) -> ReadFormat
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 ReadFormat
Source§impl Debug for ReadFormat
impl Debug for ReadFormat
Source§impl Default for ReadFormat
impl Default for ReadFormat
Source§fn default() -> ReadFormat
fn default() -> ReadFormat
impl Eq for ReadFormat
Source§impl Extend<ReadFormat> for ReadFormat
impl Extend<ReadFormat> for ReadFormat
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ReadFormat>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ReadFormat>,
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 ReadFormat
impl Flags for ReadFormat
Source§const FLAGS: &'static [Flag<ReadFormat>]
const FLAGS: &'static [Flag<ReadFormat>]
Source§fn from_bits_retain(bits: u64) -> ReadFormat
fn from_bits_retain(bits: u64) -> ReadFormat
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 intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§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.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!). Read moreSource§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.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in a flags value, truncating the result.Source§impl FromIterator<ReadFormat> for ReadFormat
impl FromIterator<ReadFormat> for ReadFormat
Source§fn from_iter<T>(iterator: T) -> ReadFormatwhere
T: IntoIterator<Item = ReadFormat>,
fn from_iter<T>(iterator: T) -> ReadFormatwhere
T: IntoIterator<Item = ReadFormat>,
The bitwise or (|) of the bits in each flags value.
Source§impl Hash for ReadFormat
impl Hash for ReadFormat
Source§impl IntoIterator for ReadFormat
impl IntoIterator for ReadFormat
Source§type Item = ReadFormat
type Item = ReadFormat
Source§type IntoIter = Iter<ReadFormat>
type IntoIter = Iter<ReadFormat>
Source§fn into_iter(self) -> <ReadFormat as IntoIterator>::IntoIter
fn into_iter(self) -> <ReadFormat as IntoIterator>::IntoIter
Source§impl LowerHex for ReadFormat
impl LowerHex for ReadFormat
Source§impl Not for ReadFormat
impl Not for ReadFormat
Source§fn not(self) -> ReadFormat
fn not(self) -> ReadFormat
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§type Output = ReadFormat
type Output = ReadFormat
! operator.Source§impl Octal for ReadFormat
impl Octal for ReadFormat
Source§impl PartialEq for ReadFormat
impl PartialEq for ReadFormat
impl StructuralPartialEq for ReadFormat
Source§impl Sub for ReadFormat
impl Sub for ReadFormat
Source§fn sub(self, other: ReadFormat) -> ReadFormat
fn sub(self, other: ReadFormat) -> ReadFormat
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.
Source§type Output = ReadFormat
type Output = ReadFormat
- operator.Source§impl SubAssign for ReadFormat
impl SubAssign for ReadFormat
Source§fn sub_assign(&mut self, other: ReadFormat)
fn sub_assign(&mut self, other: ReadFormat)
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.