Skip to main content

Pattern

Struct Pattern 

Source
pub struct Pattern { /* private fields */ }
Expand description

A pattern that passed the dialect’s checks.

Implementations§

Source§

impl Pattern

Source

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.

Source

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§

Source§

impl Debug for Pattern

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Pattern

§

impl Freeze for Pattern
where *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 Pattern
where 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
where Arc<RegexI>: Send, BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>>>: Send, RawVecInner: Send, Arc<Prog>: Send, Arc<HashMap<String, Vec<usize>>>: Send,

§

impl Sync for Pattern
where Arc<RegexI>: Sync, BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>>>: Sync, RawVecInner: Sync, Arc<Prog>: Sync, Arc<HashMap<String, Vec<usize>>>: Sync,

§

impl Unpin for Pattern
where Arc<RegexI>: Unpin, Box<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Sync + Send>>>: Unpin, *const u8 is !null: Unpin, Arc<Prog>: Unpin, Arc<HashMap<String, Vec<usize>>>: Unpin,

§

impl UnsafeUnpin for Pattern
where *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 Pattern
where 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.