pub struct Qualifiers(/* private fields */);Expand description
The qualifiers a type can carry.
A bitmask in the interning key rather than a chain of wrapper nodes, so const int is one
entry in the table beside int rather than a node pointing at it. That makes stripping
qualifiers a field read instead of a walk, which matters because almost every semantic rule
in C is stated on the unqualified type.
_Atomic is deliberately not here. C lets it be written in the same position as a
qualifier, but _Atomic(T) is a different type from T with its own size and alignment,
so it is a type constructor, TypeKind::Atomic, and the parser is what maps the
qualifier spelling onto it.
Implementations§
Source§impl Qualifiers
impl Qualifiers
Sourcepub const NONE: Qualifiers
pub const NONE: Qualifiers
No qualifiers.
Sourcepub const CONST: Qualifiers
pub const CONST: Qualifiers
const.
Sourcepub const VOLATILE: Qualifiers
pub const VOLATILE: Qualifiers
volatile.
Sourcepub const RESTRICT: Qualifiers
pub const RESTRICT: Qualifiers
restrict.
Sourcepub const fn has(self, other: Qualifiers) -> bool
pub const fn has(self, other: Qualifiers) -> bool
Whether every qualifier in other is present here.
Sourcepub const fn with(self, other: Qualifiers) -> Qualifiers
pub const fn with(self, other: Qualifiers) -> Qualifiers
This set with other added.
Sourcepub const fn without(self, other: Qualifiers) -> Qualifiers
pub const fn without(self, other: Qualifiers) -> Qualifiers
This set with other removed.
Trait Implementations§
Source§impl Clone for Qualifiers
impl Clone for Qualifiers
Source§fn clone(&self) -> Qualifiers
fn clone(&self) -> Qualifiers
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more