Struct grep::GrepBuilder [−][src]
pub struct GrepBuilder { /* fields omitted */ }
A builder for a grep searcher.
Methods
impl GrepBuilder
[src]
impl GrepBuilder
pub fn new(pattern: &str) -> GrepBuilder
[src]
pub fn new(pattern: &str) -> GrepBuilder
Create a new builder for line searching.
The pattern given should be a regular expression. The precise syntax supported is documented on the regex crate.
pub fn line_terminator(self, ascii_byte: u8) -> GrepBuilder
[src]
pub fn line_terminator(self, ascii_byte: u8) -> GrepBuilder
Set the line terminator.
The line terminator can be any ASCII character and serves to delineate the match boundaries in the text searched.
This panics if ascii_byte
is greater than 0x7F
(i.e., not ASCII).
pub fn case_insensitive(self, yes: bool) -> GrepBuilder
[src]
pub fn case_insensitive(self, yes: bool) -> GrepBuilder
Set the case sensitive flag (i
) on the regex.
pub fn case_smart(self, yes: bool) -> GrepBuilder
[src]
pub fn case_smart(self, yes: bool) -> GrepBuilder
Whether to enable smart case search or not (disabled by default).
Smart case uses case insensitive search if the pattern contains only lowercase characters (ignoring any characters which immediately follow a ''). Otherwise, a case sensitive search is used instead.
Enabling the case_insensitive flag overrides this.
pub fn size_limit(self, limit: usize) -> GrepBuilder
[src]
pub fn size_limit(self, limit: usize) -> GrepBuilder
Set the approximate size limit of the compiled regular expression.
This roughly corresponds to the number of bytes occupied by a single compiled program. If the program exceeds this number, then a compilation error is returned.
pub fn dfa_size_limit(self, limit: usize) -> GrepBuilder
[src]
pub fn dfa_size_limit(self, limit: usize) -> GrepBuilder
Set the approximate size of the cache used by the DFA.
This roughly corresponds to the number of bytes that the DFA will use while searching.
Note that this is a per thread limit. There is no way to set a global limit. In particular, if a regex is used from multiple threads simulanteously, then each thread may use up to the number of bytes specified here.
pub fn build(self) -> Result<Grep>
[src]
pub fn build(self) -> Result<Grep>
Create a line searcher.
If there was a problem parsing or compiling the regex with the given options, then an error is returned.
Trait Implementations
impl Clone for GrepBuilder
[src]
impl Clone for GrepBuilder
fn clone(&self) -> GrepBuilder
[src]
fn clone(&self) -> GrepBuilder
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for GrepBuilder
[src]
impl Debug for GrepBuilder
Auto Trait Implementations
impl Send for GrepBuilder
impl Send for GrepBuilder
impl Sync for GrepBuilder
impl Sync for GrepBuilder