pub struct Builder { /* private fields */ }
Expand description
Builder for the regexes set
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new() -> Self
pub fn new() -> Self
Instantiate a builder with the default metadata configuration:
- minimum atom length 3
Sourcepub fn new_atom_len(min_atom_len: usize) -> Self
pub fn new_atom_len(min_atom_len: usize) -> Self
Instantiate a builder with a custom minimum atom length. Increasing the atom length decreases the size and cost of the prefilter, but may make more regexes impossible to prefilter, which can increase matching costs.
Sourcepub fn push(self, s: &str) -> Result<Self, ParseError>
pub fn push(self, s: &str) -> Result<Self, ParseError>
Push a single regex into the builder, using the default parsing options.
Sourcepub fn push_opt(self, regex: &str, opts: &Options) -> Result<Self, ParseError>
pub fn push_opt(self, regex: &str, opts: &Options) -> Result<Self, ParseError>
Push a single regex into the builder, using custom parsing options.
Sourcepub fn push_all<T, I>(self, i: I) -> Result<Self, ParseError>
pub fn push_all<T, I>(self, i: I) -> Result<Self, ParseError>
Push a batch of regexes into the builder, using the default parsing options.
Sourcepub fn build(self) -> Result<Regexes, BuildError>
pub fn build(self) -> Result<Regexes, BuildError>
Build the regexes set from the current builder.
Building a regexes set from no regexes is useless but not an error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl !Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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