QualifierFlag

Trait QualifierFlag 

Source
pub trait QualifierFlag:
    BitOr<Self, Output = Self>
    + Ord
    + Hash
    + Shareable {
    // Required methods
    fn contains(&self, other: &Self) -> bool;
    fn intersects(&self, other: &Self) -> bool;
    fn set_equals(&self, other: &Self) -> bool;
    fn none() -> Self;
    fn is_none(&self) -> bool;

    // Provided method
    fn is_none_or_intersects(&self, other: &Self) -> bool { ... }
}
Expand description

A flags like Qualifier for stats, normally bitflags or a set.

An application should ideally implement one QualifierFlag and multiple Stats, since different types of stats can still interop if they use the same QualifierFlag.

Required Methods§

Source

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

Source

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

Source

fn set_equals(&self, other: &Self) -> bool

Source

fn none() -> Self

Source

fn is_none(&self) -> bool

Provided Methods§

Source

fn is_none_or_intersects(&self, other: &Self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> QualifierFlag for T
where T: BitOr<Self, Output = Self> + Ord + Hash + BitAnd<Self, Output = Self> + Default + Shareable + Copy,