Trait rustrict::CensorStr

source ·
pub trait CensorStr: Sized {
    // Required methods
    fn censor(self) -> String;
    fn is(self, threshold: Type) -> bool;

    // Provided methods
    fn is_inappropriate(self) -> bool { ... }
    fn isnt(self, threshold: Type) -> bool { ... }
}
Expand description

CensorStr makes it easy to sanitize a String or &str by calling .censor().

Required Methods§

source

fn censor(self) -> String

The output is a newly allocated, censored string.

source

fn is(self, threshold: Type) -> bool

Returns true if text meets the provided threshold.

Provided Methods§

source

fn is_inappropriate(self) -> bool

Returns true if the text is inappropriate.

source

fn isnt(self, threshold: Type) -> bool

Returns true if text does not meet the provided threshold.

Implementations on Foreign Types§

source§

impl CensorStr for &str

source§

fn censor(self) -> String

source§

fn is(self, threshold: Type) -> bool

Implementors§