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
sourceimpl Type
impl Type
sourcepub const SAFE: Self = Self(TypeRepr::SAFE)
pub const SAFE: Self = Self(TypeRepr::SAFE)
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 = Self(TypeRepr::MILD_OR_HIGHER)
pub const MILD_OR_HIGHER: Self = Self(TypeRepr::MILD_OR_HIGHER)
Any level; Type::MILD, Type::MODERATE, or Type::SEVERE.
sourcepub const MODERATE_OR_HIGHER: Self = Self(TypeRepr::MODERATE_OR_HIGHER)
pub const MODERATE_OR_HIGHER: Self = Self(TypeRepr::MODERATE_OR_HIGHER)
Any level in excess of Type::MILD.
sourcepub const INAPPROPRIATE: Self = Self(TypeRepr::INAPPROPRIATE)
pub const INAPPROPRIATE: Self = Self(TypeRepr::INAPPROPRIATE)
The default Type, meaning profane, offensive, sexual, or severely mean.
sourcepub const ANY: Self = Self(TypeRepr::ANY)
pub const ANY: Self = Self(TypeRepr::ANY)
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
this is for backwards-compatibility, use Type::NONE instead
pub fn is_empty(self) -> bool
this is for backwards-compatibility, compare with Type::NONE instead
pub fn bits(self) -> u32
this is for backwards-compatibility, there is no replacement
Trait Implementations
sourceimpl BitAndAssign<Type> for Type
impl BitAndAssign<Type> for Type
sourcefn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the &= operation. Read more
sourceimpl BitOrAssign<Type> for Type
impl BitOrAssign<Type> for Type
sourcefn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the |= operation. Read more
sourceimpl Debug for Type
impl Debug for Type
Note: Can’t impl directly on TypeRepr due to https://github.com/bitflags/bitflags/issues/218
impl Copy for Type
impl Eq for Type
impl StructuralEq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more