Struct PikeVM

Source
pub struct PikeVM {
    pub(crate) config: Config,
    pub(crate) nfa: NFA,
    pub(crate) wasm: CompiledRegex,
}
Expand description

A compiled regular expression represented as a Pike VM, ready for matching.

Fields§

§config: Config§nfa: NFA§wasm: CompiledRegex

Implementations§

Source§

impl PikeVM

Source

pub fn new(pattern: &str) -> Result<PikeVM, BuildError>

Compiles a single regular expression pattern into a new PikeVM using the default builder.

Source

pub fn new_many<P: AsRef<str>>(patterns: &[P]) -> Result<PikeVM, BuildError>

Compiles multiple regular expression patterns into a single new PikeVM using the default builder.

Source

pub fn new_from_nfa(nfa: NFA) -> Result<PikeVM, BuildError>

Creates a new PikeVM directly from a Thompson NFA using the default builder.

Source

pub fn always_match() -> Result<PikeVM, BuildError>

Creates a PikeVM that always matches the empty string at any position.

Source

pub fn never_match() -> Result<PikeVM, BuildError>

Creates a PikeVM that never matches.

Source

pub fn config() -> Config

Returns a new default Config for configuring a Builder.

Source

pub fn builder() -> Builder

Returns a new default Builder for compiling regular expressions.

Source

pub fn pattern_len(&self) -> usize

Returns the number of patterns compiled into this PikeVM.

Source

pub fn get_config(&self) -> &Config

Return the config for this PikeVM.

Note that this is the configuration used to build the PikeVM, not necessarily the configuration used for a specific match operation.

Source

pub fn get_nfa(&self) -> &NFA

Returns a reference to the underlying NFA.

This is the NFA that was compiled into the PikeVM.

Source

pub fn get_wasm(&self) -> &[u8]

Returns a reference to the compiled WASM bytes.

These bytes represent the compiled PikeVM logic.

Trait Implementations§

Source§

impl Debug for PikeVM

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for PikeVM

§

impl RefUnwindSafe for PikeVM

§

impl Send for PikeVM

§

impl Sync for PikeVM

§

impl Unpin for PikeVM

§

impl UnwindSafe for PikeVM

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.