Skip to main content

SchemaFlags

Struct SchemaFlags 

Source
pub struct SchemaFlags(/* private fields */)
where
    u32: BitsPrimitive;

Implementations§

Source§

impl SchemaFlags

Source

pub const Trades: Self

Source§

impl SchemaFlags

Source

pub const fn bits(&self) -> u32

Return the underlying bits of this bitflag.

Source

pub const fn from_bits(bits: u32) -> Option<Self>

Converts from a bits value. Returning None is any unknown bits are set.

Source

pub const fn from_bits_truncate(bits: u32) -> Self

Convert from bits value, unsetting any unknown bits.

Source

pub const fn from_bits_retain(bits: u32) -> Self

Convert from bits value exactly.

Source

pub fn from_flag_name(name: &str) -> Option<Self>

Convert from a flag name.

Source

pub const fn empty() -> Self

Construct a flags value with all bits unset.

Source

pub const fn is_empty(&self) -> bool

Returns true if the flag value has all bits unset.

Source

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.

Source

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.

Source

pub const fn all() -> Self

Construct a flag value with all known flags set.

This will only set the flags specified as associated constant.

Source

pub const fn is_all(&self) -> bool

Returns true if the flag value contais all known flags.

Source

pub const fn contains_unknown_bits(&self) -> bool

Returns true if there are any unknown bits set in the flag value.

Source

pub const fn truncated(&self) -> Self

Returns a bit flag that only has bits corresponding to the specified flags as associated constant.

Source

pub fn truncate(&mut self)

Removes unknown bits from the flag value.

Source

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()

Source

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

Source

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.

Source

pub const fn and(self, other: Self) -> Self

Returns the bitwise AND of the flag.

Source

pub const fn or(self, other: Self) -> Self

Returns the bitwise OR of the flag with other.

Source

pub const fn xor(self, other: Self) -> Self

Returns the bitwise XOR of the flag with other.

Source

pub const fn intersection(self, other: Self) -> Self

Returns the intersection from this value with other.

Source

pub const fn union(self, other: Self) -> Self

Returns the union from this value with other.

Source

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.

Source

pub const fn symmetric_difference(self, other: Self) -> Self

Returns the symmetric difference from this value with other.

Source

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

pub fn set(&mut self, other: Self)

Set the flags in other in the value.

Source

pub fn unset(&mut self, other: Self)

Unset the flags bits in other in the value.

Source

pub fn toggle(&mut self, other: Self)

Toggle the flags in other in the value.

Source§

impl SchemaFlags

Source

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.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl BitAnd for SchemaFlags

Source§

type Output = SchemaFlags

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAndAssign for SchemaFlags

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl BitOr for SchemaFlags

Source§

type Output = SchemaFlags

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOrAssign for SchemaFlags

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl BitXor for SchemaFlags

Source§

type Output = SchemaFlags

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXorAssign for SchemaFlags

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl Clone for SchemaFlags

Source§

fn clone(&self) -> SchemaFlags

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SchemaFlags

Source§

impl Debug for SchemaFlags

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SchemaFlags

Source§

impl Extend<SchemaFlags> for SchemaFlags

Source§

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)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl Flags for SchemaFlags

Source§

const KNOWN_FLAGS: &'static [(&'static str, SchemaFlags)]

The set of named defined flags.
Source§

const EXTRA_VALID_BITS: u32

Extra possible bits values for the flags. Read more
Source§

type Bits = u32

The underlying bits type.
Source§

fn bits(&self) -> Self::Bits

Return the underlying bits of this bitflag. Read more
Source§

fn from_bits_retain(bits: Self::Bits) -> Self

Convert from bits value exactly.
Source§

fn from_bits(bits: Self::Bits) -> Option<Self>

Converts from a bits value. Returning None is any unknown bits are set.
Source§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from bits value, unsetting any unknown bits.
Source§

fn from_flag_name(name: &str) -> Option<Self>

Convert from a flag name.
Source§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
Source§

fn empty() -> Self

Construct a flag value with all bits unset.
Source§

fn is_empty(&self) -> bool

Returns true if the flag value has all bits unset.
Source§

fn all_bits() -> Self

Returns a flag value that contains all value. Read more
Source§

fn is_all_bits(&self) -> bool

Returns true if the bitflag contains all value bits set. Read more
Source§

fn all() -> Self

Construct a flag value with all known flags set. Read more
Source§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
Source§

fn contains_unknown_bits(&self) -> bool

Returns true if there are any unknown bits set in the flag value.
Source§

fn truncated(&self) -> Self

Returns a bit flag that only has bits corresponding to the specified flags as associated constant.
Source§

fn intersects(&self, other: Self) -> bool
where Self: Sized,

Returns true if this flag value intersects with any value in other. Read more
Source§

fn contains(&self, other: Self) -> bool
where Self: Sized,

Returns true if this flag value contains all values of other. Read more
Source§

fn truncate(&mut self)
where Self: Sized,

Remove any unknown bits from the flags.
Source§

fn intersection(self, other: Self) -> Self

Returns the intersection from this value with other.
Source§

fn union(self, other: Self) -> Self

Returns the union from this value with other.
Source§

fn difference(self, other: Self) -> Self

Returns the difference from this value with other. Read more
Source§

fn symmetric_difference(self, other: Self) -> Self

TReturns the symmetric difference from this value with other..
Source§

fn complement(self) -> Self

Returns the complement of the value. Read more
Source§

fn set(&mut self, other: Self)
where Self: Sized,

Set the flags in other in the value.
Source§

fn unset(&mut self, other: Self)
where Self: Sized,

/// Unset the flags bits in other in the value. Read more
Source§

fn toggle(&mut self, other: Self)
where Self: Sized,

Toggle the flags in other in the value.
Source§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
Source§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
Source§

impl From<&Schema> for SchemaFlags

Source§

fn from(value: &Schema) -> Self

Converts to this type from the input type.
Source§

impl From<Schema> for SchemaFlags

Source§

fn from(value: Schema) -> Self

Converts to this type from the input type.
Source§

impl From<SchemaFlags> for u32

Source§

fn from(val: SchemaFlags) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for SchemaFlags

Source§

fn from(val: u32) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<SchemaFlags> for SchemaFlags

Source§

fn from_iter<T: IntoIterator<Item = Self>>(iter: T) -> Self

Create a SchemaFlags from a iterator of flags.

Source§

impl FromStr for SchemaFlags

Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

fn from_str(input: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for SchemaFlags

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoIterator for SchemaFlags

Source§

type Item = SchemaFlags

The type of the elements being iterated over.
Source§

type IntoIter = Iter<SchemaFlags>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl IntoIterator for &SchemaFlags

Source§

type Item = SchemaFlags

The type of the elements being iterated over.
Source§

type IntoIter = Iter<SchemaFlags>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl LowerHex for SchemaFlags

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Not for SchemaFlags

Source§

type Output = SchemaFlags

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl Octal for SchemaFlags

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Ord for SchemaFlags

Source§

fn cmp(&self, other: &SchemaFlags) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for SchemaFlags

Source§

fn eq(&self, other: &SchemaFlags) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for SchemaFlags

Source§

fn partial_cmp(&self, other: &SchemaFlags) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for SchemaFlags

Source§

impl Sub for SchemaFlags

Source§

fn sub(self, rhs: Self) -> Self::Output

The intersection of a source flag with the complement of a target flags value

Source§

type Output = SchemaFlags

The resulting type after applying the - operator.
Source§

impl SubAssign for SchemaFlags

Source§

fn sub_assign(&mut self, rhs: Self)

The intersection of a source flag with the complement of a target flags value

Source§

impl UpperHex for SchemaFlags

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.