pub struct Type(_);Expand description
Type is represents a type or severity of inappropriateness. They can be combined with bitwise AND and OR operators, and are not mutually exclusive.
For example, the following means profane or at-least moderately mean:
Type::PROFANE | (Type::MEAN & Type::MODERATE_OR_HIGHER)
Implementations§
source§impl Type
impl Type
sourcepub const SAFE: Self = _
pub const SAFE: Self = _
One of a very small number of safe phases. Recommended to enforce this on users who repeatedly evade the filter.
sourcepub const MILD_OR_HIGHER: Self = _
pub const MILD_OR_HIGHER: Self = _
Any level; Type::MILD, Type::MODERATE, or Type::SEVERE.
sourcepub const MODERATE_OR_HIGHER: Self = _
pub const MODERATE_OR_HIGHER: Self = _
Any level in excess of Type::MILD.
sourcepub const INAPPROPRIATE: Self = _
pub const INAPPROPRIATE: Self = _
The default Type, meaning profane, offensive, sexual, or severely mean.
sourcepub const ANY: Self = _
pub const ANY: Self = _
Any type of detection (except SAFE). This will be expanded to cover all future types.
sourcepub fn is(self, threshold: Self) -> bool
pub fn is(self, threshold: Self) -> bool
Returns true if and only if self, the analysis result, meets the given threshold.
pub fn empty() -> Self
pub fn is_empty(self) -> bool
pub fn bits(self) -> u32
Trait Implementations§
source§impl BitAndAssign<Type> for Type
impl BitAndAssign<Type> for Type
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moresource§impl BitOrAssign<Type> for Type
impl BitOrAssign<Type> for Type
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moresource§impl Debug for Type
impl Debug for Type
Note: Can’t impl directly on TypeRepr due to https://github.com/bitflags/bitflags/issues/218