#[repr(u8)]pub enum CountingBehavior {
Nonmonotonic = 1,
Monotonic = 2,
Increment = 4,
Decrement = 8,
Acyclic = 16,
Cyclic = 32,
}Expand description
Counting behaviors
Variants§
Nonmonotonic = 1
Non monotonic (default)
Monotonic = 2
In monotonic mode, values of the counter have consistent such the differences between any two values (taken in the order they were produced) will not change sign
Increment = 4
Increases unless order is specified (default)
Decrement = 8
Decreases unless order is specified
Acyclic = 16
Stops at overflow limit (default)
Cyclic = 32
Wraps around on overflow
Implementations§
Source§impl CountingBehavior
impl CountingBehavior
Sourcepub fn conflicts(&self, rhs: &Self) -> CountingBehaviorConflict
pub fn conflicts(&self, rhs: &Self) -> CountingBehaviorConflict
Do these counting behaviors conflict?
Sourcepub fn make_behavior_flags(s: &[Self]) -> BitFlags<CountingBehavior>
pub fn make_behavior_flags(s: &[Self]) -> BitFlags<CountingBehavior>
Make behavior
Trait Implementations§
Source§impl BitAnd for CountingBehavior
impl BitAnd for CountingBehavior
Source§impl BitFlag for CountingBehavior
impl BitFlag for CountingBehavior
Source§fn empty() -> BitFlags<Self>
fn empty() -> BitFlags<Self>
Create a
BitFlags with no flags set (in other words, with a value of 0). Read moreSource§fn from_bits(bits: Self::Numeric) -> Result<BitFlags<Self>, FromBitsError<Self>>
fn from_bits(bits: Self::Numeric) -> Result<BitFlags<Self>, FromBitsError<Self>>
Create a
BitFlags if the raw value provided does not contain
any illegal flags. Read moreSource§fn from_bits_truncate(bits: Self::Numeric) -> BitFlags<Self>
fn from_bits_truncate(bits: Self::Numeric) -> BitFlags<Self>
Create a
BitFlags from an underlying bitwise value. If any
invalid bits are set, ignore them. Read moreSource§unsafe fn from_bits_unchecked(bits: Self::Numeric) -> BitFlags<Self>
unsafe fn from_bits_unchecked(bits: Self::Numeric) -> BitFlags<Self>
Create a
BitFlags unsafely, without checking if the bits form
a valid bit pattern for the type. Read moreSource§impl BitOr for CountingBehavior
impl BitOr for CountingBehavior
Source§impl BitXor for CountingBehavior
impl BitXor for CountingBehavior
Source§impl Clone for CountingBehavior
impl Clone for CountingBehavior
Source§fn clone(&self) -> CountingBehavior
fn clone(&self) -> CountingBehavior
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CountingBehavior
impl Debug for CountingBehavior
Source§impl Hash for CountingBehavior
impl Hash for CountingBehavior
Source§impl Not for CountingBehavior
impl Not for CountingBehavior
Source§impl Ord for CountingBehavior
impl Ord for CountingBehavior
Source§fn cmp(&self, other: &CountingBehavior) -> Ordering
fn cmp(&self, other: &CountingBehavior) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CountingBehavior
impl PartialEq for CountingBehavior
Source§impl PartialOrd for CountingBehavior
impl PartialOrd for CountingBehavior
Source§impl RawBitFlags for CountingBehavior
impl RawBitFlags for CountingBehavior
Source§const EMPTY: <Self as RawBitFlags>::Numeric = {transmute(0x00): <counter::behavior::CountingBehavior as enumflags2::_internal::RawBitFlags>::Numeric}
const EMPTY: <Self as RawBitFlags>::Numeric = {transmute(0x00): <counter::behavior::CountingBehavior as enumflags2::_internal::RawBitFlags>::Numeric}
A value with no bits set.
Source§const DEFAULT: <Self as RawBitFlags>::Numeric = {transmute(0x15): <counter::behavior::CountingBehavior as enumflags2::_internal::RawBitFlags>::Numeric}
const DEFAULT: <Self as RawBitFlags>::Numeric = {transmute(0x15): <counter::behavior::CountingBehavior as enumflags2::_internal::RawBitFlags>::Numeric}
The value used by the Default implementation. Equivalent to EMPTY, unless
customized.
Source§const ALL_BITS: <Self as RawBitFlags>::Numeric = {transmute(0x3f): <counter::behavior::CountingBehavior as enumflags2::_internal::RawBitFlags>::Numeric}
const ALL_BITS: <Self as RawBitFlags>::Numeric = {transmute(0x3f): <counter::behavior::CountingBehavior as enumflags2::_internal::RawBitFlags>::Numeric}
A value with all flag bits set.
Source§const BITFLAGS_TYPE_NAME: &'static str = "BitFlags<CountingBehavior>"
const BITFLAGS_TYPE_NAME: &'static str = "BitFlags<CountingBehavior>"
The name of the type for debug formatting purposes. Read more
impl Copy for CountingBehavior
impl Eq for CountingBehavior
impl StructuralPartialEq for CountingBehavior
Auto Trait Implementations§
impl Freeze for CountingBehavior
impl RefUnwindSafe for CountingBehavior
impl Send for CountingBehavior
impl Sync for CountingBehavior
impl Unpin for CountingBehavior
impl UnwindSafe for CountingBehavior
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more