pub struct Type(/* private fields */);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
Inappropriate for general audiences (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
👎Deprecated: this is for backwards-compatibility, use Type::NONE instead
pub fn is_empty(self) -> bool
👎Deprecated: this is for backwards-compatibility, compare with Type::NONE instead
pub fn bits(self) -> u32
👎Deprecated: this is for backwards-compatibility, there is no replacement
Trait Implementations§
Source§impl BitAndAssign for Type
impl BitAndAssign for Type
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&= operation. Read moreSource§impl BitOrAssign for Type
impl BitOrAssign for Type
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|= operation. Read moreimpl Copy for Type
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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