Struct spinoso_regexp::Config
source · pub struct Config { /* private fields */ }
Expand description
A Config
represents the parsed, expanded, and normalized pattern and
options used to initialize a Regexp
.
A Config
is derived from a Source
.
When a Regexp
is cloned, it is cloned from its compiled Config
.
Implementations§
source§impl Config
impl Config
sourcepub const fn new() -> Self
pub const fn new() -> Self
Construct a new, empty Config
.
Examples
use spinoso_regexp::Config;
const CONFIG: Config = Config::new();
assert!(CONFIG.pattern().is_empty());
assert!(CONFIG.options().as_display_modifier().is_empty());
sourcepub const fn with_pattern_and_options(
pattern: Vec<u8>,
options: Options
) -> Self
pub const fn with_pattern_and_options( pattern: Vec<u8>, options: Options ) -> Self
Construct a new Config
with the given pattern and Options
.
Examples
use spinoso_regexp::{Config, Options};
let config = Config::with_pattern_and_options(
b"Artichoke( Ruby)?".to_vec(),
Options::with_ignore_case(),
);
assert_eq!(config.pattern(), b"Artichoke( Ruby)?");
assert_eq!(config.options().as_display_modifier(), "i");
Trait Implementations§
source§impl Ord for Config
impl Ord for Config
source§impl PartialEq<Config> for Config
impl PartialEq<Config> for Config
source§impl PartialOrd<Config> for Config
impl PartialOrd<Config> for Config
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Config
impl StructuralEq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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