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: ShapeFlags
pub const UNTAGGED: ShapeFlags
Enum is untagged (no discriminant in serialized form).
Set by #[facet(untagged)].
Sourcepub const NUMERIC: ShapeFlags
pub const NUMERIC: ShapeFlags
Serializes/Deserializers enum to/from integer based on variant discriminant,
Set by #[facet(is_numeric)].
Sourcepub const POD: ShapeFlags
pub const POD: ShapeFlags
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: ShapeFlags
pub const METADATA_CONTAINER: ShapeFlags
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 empty() -> ShapeFlags
pub const fn empty() -> ShapeFlags
An empty set of flags.
Sourcepub const fn contains(self, other: ShapeFlags) -> bool
pub const fn contains(self, other: ShapeFlags) -> bool
Returns true if all flags in other are contained in self.
Sourcepub const fn insert(&mut self, other: ShapeFlags)
pub const fn insert(&mut self, other: ShapeFlags)
Inserts the flags in other into self.
Sourcepub const fn remove(&mut self, other: ShapeFlags)
pub const fn remove(&mut self, other: ShapeFlags)
Removes the flags in other from self.
Sourcepub const fn union(self, other: ShapeFlags) -> ShapeFlags
pub const fn union(self, other: ShapeFlags) -> ShapeFlags
Returns the union of self and other.
Sourcepub const fn intersection(self, other: ShapeFlags) -> ShapeFlags
pub const fn intersection(self, other: ShapeFlags) -> ShapeFlags
Returns the intersection of self and other.
Sourcepub const fn from_bits_retain(bits: u16) -> ShapeFlags
pub const fn from_bits_retain(bits: u16) -> ShapeFlags
Creates from raw bits (unchecked).
Trait Implementations§
Source§impl BitAnd for ShapeFlags
impl BitAnd for ShapeFlags
Source§type Output = ShapeFlags
type Output = ShapeFlags
& operator.Source§fn bitand(self, rhs: ShapeFlags) -> ShapeFlags
fn bitand(self, rhs: ShapeFlags) -> ShapeFlags
& operation. Read moreSource§impl BitAndAssign for ShapeFlags
impl BitAndAssign for ShapeFlags
Source§fn bitand_assign(&mut self, rhs: ShapeFlags)
fn bitand_assign(&mut self, rhs: ShapeFlags)
&= operation. Read moreSource§impl BitOr for ShapeFlags
impl BitOr for ShapeFlags
Source§type Output = ShapeFlags
type Output = ShapeFlags
| operator.Source§fn bitor(self, rhs: ShapeFlags) -> ShapeFlags
fn bitor(self, rhs: ShapeFlags) -> ShapeFlags
| operation. Read moreSource§impl BitOrAssign for ShapeFlags
impl BitOrAssign for ShapeFlags
Source§fn bitor_assign(&mut self, rhs: ShapeFlags)
fn bitor_assign(&mut self, rhs: ShapeFlags)
|= operation. Read moreSource§impl BitXor for ShapeFlags
impl BitXor for ShapeFlags
Source§type Output = ShapeFlags
type Output = ShapeFlags
^ operator.Source§fn bitxor(self, rhs: ShapeFlags) -> ShapeFlags
fn bitxor(self, rhs: ShapeFlags) -> ShapeFlags
^ operation. Read moreSource§impl BitXorAssign for ShapeFlags
impl BitXorAssign for ShapeFlags
Source§fn bitxor_assign(&mut self, rhs: ShapeFlags)
fn bitxor_assign(&mut self, rhs: ShapeFlags)
^= 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 moreSource§impl Debug for ShapeFlags
impl Debug for ShapeFlags
Source§impl Default for ShapeFlags
impl Default for ShapeFlags
Source§fn default() -> ShapeFlags
fn default() -> ShapeFlags
Source§impl Hash for ShapeFlags
impl Hash for ShapeFlags
Source§impl Not for ShapeFlags
impl Not for ShapeFlags
Source§type Output = ShapeFlags
type Output = ShapeFlags
! operator.Source§fn not(self) -> ShapeFlags
fn not(self) -> ShapeFlags
! operation. Read more