pub struct TreMatchOpts {
pub max_errors: u16,
pub cost_ins: u16,
pub cost_del: u16,
pub cost_subst: u16,
pub max_cost: u16,
pub case_insensitive: bool,
}Expand description
Per-pattern matching configuration.
max_errors is the headline knob: it bounds the number of
edit operations tolerated in a match. cost_* weight each
edit kind; if all weights are 1 the cost equals the edit
distance. max_cost bounds the cumulative cost; setting it
to 0 with max_errors > 0 is rejected because it forces
exact match no matter what edits are allowed.
case_insensitive toggles TRE’s REG_ICASE flag.
Fields§
§max_errors: u16Maximum number of edit operations (insert + delete + substitute) permitted in a match.
cost_ins: u16Cost of inserting one byte. Defaults to 1.
cost_del: u16Cost of deleting one byte. Defaults to 1.
cost_subst: u16Cost of substituting one byte. Defaults to 1.
max_cost: u16Cumulative cost ceiling. Zero means “use
max_errors * max(cost_*) as the implicit ceiling”.
case_insensitive: boolMatch case-insensitively.
Trait Implementations§
Source§impl Clone for TreMatchOpts
impl Clone for TreMatchOpts
Source§fn clone(&self) -> TreMatchOpts
fn clone(&self) -> TreMatchOpts
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TreMatchOpts
impl Debug for TreMatchOpts
Source§impl Default for TreMatchOpts
impl Default for TreMatchOpts
impl Copy for TreMatchOpts
Auto Trait Implementations§
impl Freeze for TreMatchOpts
impl RefUnwindSafe for TreMatchOpts
impl Send for TreMatchOpts
impl Sync for TreMatchOpts
impl Unpin for TreMatchOpts
impl UnsafeUnpin for TreMatchOpts
impl UnwindSafe for TreMatchOpts
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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