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 Patternwhere
*const ArcInner<RegexI> is !null: Freeze,
PhantomData<ArcInner<RegexI>>: Freeze,
*const Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>> is !null: Freeze,
PhantomData<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<u32>: Freeze,
*const ArcInner<Prog> is !null: Freeze,
PhantomData<ArcInner<Prog>>: Freeze,
*const ArcInner<HashMap<String, Vec<usize>>> is !null: Freeze,
PhantomData<ArcInner<HashMap<String, Vec<usize>>>>: Freeze,
impl Move for Pattern
impl RefUnwindSafe for Patternwhere
Atomic<usize>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>>: RefUnwindSafe,
Pool<Scratch, fn() -> Scratch>: RefUnwindSafe,
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin for Patternwhere
*const ArcInner<RegexI> is !null: UnsafeUnpin,
PhantomData<ArcInner<RegexI>>: UnsafeUnpin,
*const Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>> is !null: UnsafeUnpin,
PhantomData<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
*const ArcInner<Prog> is !null: UnsafeUnpin,
PhantomData<ArcInner<Prog>>: UnsafeUnpin,
*const ArcInner<HashMap<String, Vec<usize>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<HashMap<String, Vec<usize>>>>: UnsafeUnpin,
impl UnwindSafe for Patternwhere
Arc<RegexI>: UnwindSafe,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>>>: UnwindSafe,
RawVecInner: UnwindSafe,
Arc<Prog>: UnwindSafe,
Arc<HashMap<String, Vec<usize>>>: UnwindSafe,
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