pub struct SchemaFlags(/* private fields */)
where
u32: BitsPrimitive;Implementations§
Source§impl SchemaFlags
impl SchemaFlags
Source§impl SchemaFlags
impl SchemaFlags
Sourcepub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Converts from a bits value. Returning None is 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 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 bits value exactly.
Sourcepub fn from_flag_name(name: &str) -> Option<Self>
pub fn from_flag_name(name: &str) -> Option<Self>
Convert from a flag name.
Sourcepub const fn all_bits() -> Self
pub const fn all_bits() -> Self
Returns a flag value that contains all value.
This will include bits that do not have any flags/meaning.
Use all if you want only the specified flags set.
Sourcepub const fn is_all_bits(&self) -> bool
pub const fn is_all_bits(&self) -> bool
Returns true if the flag value contains all value bits set.
This will check for all bits.
Use is_all if you want to check for all specified flags.
Sourcepub const fn all() -> Self
pub const fn all() -> Self
Construct a flag value with all known flags set.
This will only set the flags specified as associated constant.
Sourcepub const fn contains_unknown_bits(&self) -> bool
pub const fn contains_unknown_bits(&self) -> bool
Returns true if there are any unknown bits set in the flag value.
Sourcepub const fn truncated(&self) -> Self
pub const fn truncated(&self) -> Self
Returns a bit flag that only has bits corresponding to the specified flags as associated constant.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true if this flag value intersects with any value in other.
This is equivalent to (self & other) != Self::empty()
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true if this flag value contains all values of other.
This is equivalent to (self & other) == other
Sourcepub const fn not(self) -> Self
pub const fn not(self) -> Self
Returns the bitwise NOT of the flag.
This function does not truncate unused bits (bits that do not have any flags/meaning).
Use complement if you want that the result to be truncated in one call.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection from this value with other.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference from this value with other.
In other words, returns the intersection of this value with the negation of other.
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
Returns the symmetric difference from this value with other.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
Returns the complement of the value.
This is very similar to the not, but truncates non used bits.
Source§impl SchemaFlags
impl SchemaFlags
Sourcepub const fn iter(&self) -> Iter<Self> ⓘ
pub const fn iter(&self) -> Iter<Self> ⓘ
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<Self> ⓘ
pub const fn iter_names(&self) -> IterNames<Self> ⓘ
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 SchemaFlags
impl Binary for SchemaFlags
Source§impl BitAnd for SchemaFlags
impl BitAnd for SchemaFlags
Source§impl BitAndAssign for SchemaFlags
impl BitAndAssign for SchemaFlags
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl BitOr for SchemaFlags
impl BitOr for SchemaFlags
Source§impl BitOrAssign for SchemaFlags
impl BitOrAssign for SchemaFlags
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl BitXor for SchemaFlags
impl BitXor for SchemaFlags
Source§impl BitXorAssign for SchemaFlags
impl BitXorAssign for SchemaFlags
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreSource§impl Clone for SchemaFlagswhere
u32: BitsPrimitive,
impl Clone for SchemaFlagswhere
u32: BitsPrimitive,
Source§fn clone(&self) -> SchemaFlags
fn clone(&self) -> SchemaFlags
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 SchemaFlagswhere
u32: BitsPrimitive,
Source§impl Debug for SchemaFlags
impl Debug for SchemaFlags
impl Eq for SchemaFlagswhere
u32: BitsPrimitive,
Source§impl Extend<SchemaFlags> for SchemaFlags
impl Extend<SchemaFlags> for SchemaFlags
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iter: T)
Set all flags of iter to self
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 SchemaFlags
impl Flags for SchemaFlags
Source§const KNOWN_FLAGS: &'static [(&'static str, SchemaFlags)]
const KNOWN_FLAGS: &'static [(&'static str, SchemaFlags)]
Source§const EXTRA_VALID_BITS: u32
const EXTRA_VALID_BITS: u32
Source§fn from_bits_retain(bits: Self::Bits) -> Self
fn from_bits_retain(bits: Self::Bits) -> Self
bits value exactly.Source§fn from_bits(bits: Self::Bits) -> Option<Self>
fn from_bits(bits: Self::Bits) -> Option<Self>
bits value. Returning None is any unknown bits are set.Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
bits value, unsetting any unknown bits.Source§fn from_flag_name(name: &str) -> Option<Self>
fn from_flag_name(name: &str) -> Option<Self>
name.Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn is_all_bits(&self) -> bool
fn is_all_bits(&self) -> bool
true if the bitflag contains all value bits set. Read moreSource§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if there are any unknown bits set in the flag value.Source§fn truncated(&self) -> Self
fn truncated(&self) -> Self
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
other.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
other. Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
other..Source§fn complement(self) -> Self
fn complement(self) -> Self
Source§impl From<&Schema> for SchemaFlags
impl From<&Schema> for SchemaFlags
Source§impl From<Schema> for SchemaFlags
impl From<Schema> for SchemaFlags
Source§impl From<SchemaFlags> for u32
impl From<SchemaFlags> for u32
Source§fn from(val: SchemaFlags) -> Self
fn from(val: SchemaFlags) -> Self
Source§impl From<u32> for SchemaFlags
impl From<u32> for SchemaFlags
Source§impl FromIterator<SchemaFlags> for SchemaFlags
impl FromIterator<SchemaFlags> for SchemaFlags
Source§fn from_iter<T: IntoIterator<Item = Self>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iter: T) -> Self
Create a SchemaFlags from a iterator of flags.
Source§impl FromStr for SchemaFlags
impl FromStr for SchemaFlags
Source§impl Hash for SchemaFlagswhere
u32: BitsPrimitive,
impl Hash for SchemaFlagswhere
u32: BitsPrimitive,
Source§impl IntoIterator for SchemaFlags
impl IntoIterator for SchemaFlags
Source§impl IntoIterator for &SchemaFlags
impl IntoIterator for &SchemaFlags
Source§impl LowerHex for SchemaFlags
impl LowerHex for SchemaFlags
Source§impl Not for SchemaFlags
impl Not for SchemaFlags
Source§impl Octal for SchemaFlags
impl Octal for SchemaFlags
Source§impl Ord for SchemaFlagswhere
u32: BitsPrimitive,
impl Ord for SchemaFlagswhere
u32: BitsPrimitive,
Source§fn cmp(&self, other: &SchemaFlags) -> Ordering
fn cmp(&self, other: &SchemaFlags) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SchemaFlagswhere
u32: BitsPrimitive,
impl PartialEq for SchemaFlagswhere
u32: BitsPrimitive,
Source§impl PartialOrd for SchemaFlagswhere
u32: BitsPrimitive,
impl PartialOrd for SchemaFlagswhere
u32: BitsPrimitive,
impl StructuralPartialEq for SchemaFlagswhere
u32: BitsPrimitive,
Source§impl Sub for SchemaFlags
impl Sub for SchemaFlags
Source§impl SubAssign for SchemaFlags
impl SubAssign for SchemaFlags
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
The intersection of a source flag with the complement of a target flags value