pub struct StatFlags(/* private fields */);
Expand description
Kernel flags for a process
See also the Stat::flags() method.
Implementations§
Source§impl StatFlags
impl StatFlags
Sourcepub const PF_EXITING: Self
pub const PF_EXITING: Self
Getting shut down
Sourcepub const PF_EXITPIDONE: Self
pub const PF_EXITPIDONE: Self
PI exit done on shut down
Sourcepub const PF_WQ_WORKER: Self
pub const PF_WQ_WORKER: Self
I’m a workqueue worker
Sourcepub const PF_FORKNOEXEC: Self
pub const PF_FORKNOEXEC: Self
Forked but didn’t exec
Sourcepub const PF_MCE_PROCESS: Self
pub const PF_MCE_PROCESS: Self
Process policy on mce errors;
Sourcepub const PF_SUPERPRIV: Self
pub const PF_SUPERPRIV: Self
Used super-user privileges
Sourcepub const PF_DUMPCORE: Self
pub const PF_DUMPCORE: Self
Dumped core
Sourcepub const PF_SIGNALED: Self
pub const PF_SIGNALED: Self
Killed by a signal
Sourcepub const PF_MEMALLOC: Self
pub const PF_MEMALLOC: Self
Allocating memory
Sourcepub const PF_NPROC_EXCEEDED: Self
pub const PF_NPROC_EXCEEDED: Self
set_user() noticed that RLIMIT_NPROC was exceeded
Sourcepub const PF_USED_MATH: Self
pub const PF_USED_MATH: Self
If unset the fpu must be initialized before use
Sourcepub const PF_USED_ASYNC: Self
pub const PF_USED_ASYNC: Self
Used async_schedule*(), used by module init
Sourcepub const PF_NOFREEZE: Self
pub const PF_NOFREEZE: Self
This thread should not be frozen
Sourcepub const PF_MEMALLOC_NOFS: Self
pub const PF_MEMALLOC_NOFS: Self
All allocation requests will inherit GFP_NOFS
Sourcepub const PF_MEMALLOC_NOIO: Self
pub const PF_MEMALLOC_NOIO: Self
All allocation requests will inherit GFP_NOIO
Sourcepub const PF_LESS_THROTTLE: Self
pub const PF_LESS_THROTTLE: Self
Throttle me less: I clean memory
Sourcepub const PF_KTHREAD: Self
pub const PF_KTHREAD: Self
I am a kernel thread
Sourcepub const PF_RANDOMIZE: Self
pub const PF_RANDOMIZE: Self
Randomize virtual address space
Sourcepub const PF_SWAPWRITE: Self
pub const PF_SWAPWRITE: Self
Allowed to write to swap
Sourcepub const PF_MEMSTALL: Self
pub const PF_MEMSTALL: Self
Stalled due to lack of memory
Sourcepub const PF_NO_SETAFFINITY: Self
pub const PF_NO_SETAFFINITY: Self
Userland is not allowed to meddle with cpus_allowed
Sourcepub const PF_MCE_EARLY: Self
pub const PF_MCE_EARLY: Self
Early kill for mce process policy
Sourcepub const PF_MEMALLOC_NOCMA: Self
pub const PF_MEMALLOC_NOCMA: Self
All allocation request will have _GFP_MOVABLE cleared
Sourcepub const PF_MUTEX_TESTER: Self
pub const PF_MUTEX_TESTER: Self
Thread belongs to the rt mutex tester
Sourcepub const PF_FREEZER_SKIP: Self
pub const PF_FREEZER_SKIP: Self
Freezer should not count it as freezable
Sourcepub const PF_SUSPEND_TASK: Self
pub const PF_SUSPEND_TASK: Self
This thread called freeze_processes() and should not be frozen
Source§impl StatFlags
impl StatFlags
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<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u32) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u32) -> Self
pub const fn from_bits_retain(bits: u32) -> Self
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
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: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
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: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
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: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§impl StatFlags
impl StatFlags
Sourcepub const fn iter(&self) -> Iter<StatFlags>
pub const fn iter(&self) -> Iter<StatFlags>
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<StatFlags>
pub const fn iter_names(&self) -> IterNames<StatFlags>
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 BitAndAssign for StatFlags
impl BitAndAssign for StatFlags
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
Source§impl BitOrAssign for StatFlags
impl BitOrAssign for StatFlags
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
Source§impl BitXorAssign for StatFlags
impl BitXorAssign for StatFlags
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§impl<'de> Deserialize<'de> for StatFlags
impl<'de> Deserialize<'de> for StatFlags
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Extend<StatFlags> for StatFlags
impl Extend<StatFlags> for StatFlags
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
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
)Source§impl Flags for StatFlags
impl Flags for StatFlags
Source§fn from_bits_retain(bits: u32) -> StatFlags
fn from_bits_retain(bits: u32) -> StatFlags
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 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<StatFlags> for StatFlags
impl FromIterator<StatFlags> for StatFlags
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
Source§impl IntoIterator for StatFlags
impl IntoIterator for StatFlags
Source§impl Ord for StatFlags
impl Ord for StatFlags
Source§impl PartialOrd for StatFlags
impl PartialOrd for StatFlags
Source§impl Sub for StatFlags
impl Sub for StatFlags
Source§impl SubAssign for StatFlags
impl SubAssign for StatFlags
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
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.