pub struct ShapeFlags(/* private fields */);Expand description
Bit flags for common shape-level attributes.
These provide O(1) access to frequently-checked boolean attributes, avoiding the O(n) linear scan through the attributes slice.
Implementations§
Source§impl ShapeFlags
impl ShapeFlags
Sourcepub const UNTAGGED: Self
pub const UNTAGGED: Self
Enum is untagged (no discriminant in serialized form).
Set by #[facet(untagged)].
Sourcepub const NUMERIC: Self
pub const NUMERIC: Self
Serializes/Deserializers enum to/from integer based on variant discriminant,
Set by #[facet(is_numeric)].
Sourcepub const POD: Self
pub const POD: Self
Plain Old Data - type has no invariants and any combination of valid field values produces a valid instance.
This enables safe mutation through reflection (poke operations).
Set by #[facet(pod)].
Sourcepub const METADATA_CONTAINER: Self
pub const METADATA_CONTAINER: Self
Metadata container - serializes transparently through the non-metadata field while preserving metadata fields for formats that support them.
Set by #[facet(metadata_container)].
Sourcepub const fn contains(self, other: Self) -> bool
pub const fn contains(self, other: Self) -> bool
Returns true if all flags in other are contained in self.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection of self and other.
Sourcepub const fn from_bits_retain(bits: u16) -> Self
pub const fn from_bits_retain(bits: u16) -> Self
Creates from raw bits (unchecked).
Trait Implementations§
Source§impl BitAnd for ShapeFlags
impl BitAnd for ShapeFlags
Source§impl BitAndAssign for ShapeFlags
impl BitAndAssign for ShapeFlags
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl BitOr for ShapeFlags
impl BitOr for ShapeFlags
Source§impl BitOrAssign for ShapeFlags
impl BitOrAssign for ShapeFlags
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl BitXor for ShapeFlags
impl BitXor for ShapeFlags
Source§impl BitXorAssign for ShapeFlags
impl BitXorAssign for ShapeFlags
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreSource§impl Clone for ShapeFlags
impl Clone for ShapeFlags
Source§fn clone(&self) -> ShapeFlags
fn clone(&self) -> ShapeFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more