pub struct Pattern { /* private fields */ }Expand description
A pattern that passed the dialect’s checks.
Implementations§
Source§impl Pattern
impl Pattern
Sourcepub fn compile(pattern: &str) -> Result<Pattern, Refusal>
pub fn compile(pattern: &str) -> Result<Pattern, Refusal>
Parse and check pattern, refusing it with the specification’s reason
when it is outside the dialect or unsafe.
Sourcepub fn test(&self, value: &str) -> bool
pub fn test(&self, value: &str) -> bool
Whether the pattern matches anywhere in value (RegExp.test). A
value longer than MAX_VALUE_CODE_POINTS does not match; neither
does one that exhausts the backtracking limit.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Pattern
impl Freeze for Pattern
impl Move for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin for Pattern
impl UnwindSafe for Pattern
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