pub struct CompiledRules { /* private fields */ }Expand description
Rules ready to run. Built once per change of the rules file or format.
Implementations§
Source§impl CompiledRules
impl CompiledRules
Sourcepub fn compile(
rules: &RulesFile,
options: &Options,
recognizer: Option<Arc<dyn EntityRecognizer>>,
) -> Result<Self, RulesError>
pub fn compile( rules: &RulesFile, options: &Options, recognizer: Option<Arc<dyn EntityRecognizer>>, ) -> Result<Self, RulesError>
Compiles rules with options. recognizer is the name-detection
model; if the rules turn name detection on and it is None, scanning
fails until rules are compiled with one, so names are never sent.
Sourcepub fn ner_missing(&self) -> bool
pub fn ner_missing(&self) -> bool
True if the rules turn name detection on but no model was supplied.
Sourcepub fn ner_enabled(&self) -> bool
pub fn ner_enabled(&self) -> bool
True if the rules turn name detection on.
Sourcepub fn placeholder(&self) -> &PlaceholderFormat
pub fn placeholder(&self) -> &PlaceholderFormat
The placeholder format these rules use.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CompiledRules
impl !UnwindSafe for CompiledRules
impl Freeze for CompiledRules
impl Send for CompiledRules
impl Sync for CompiledRules
impl Unpin for CompiledRules
impl UnsafeUnpin for CompiledRules
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more