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 moresource§impl PartialEq for Type
impl PartialEq for Type
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§
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