Struct Parser

struct Parser { ... }

A regular expression parser.

This parses a string representation of a regular expression into an abstract syntax tree. The size of the tree is proportional to the length of the regular expression pattern.

A Parser can be configured in more detail via a ParserBuilder.

Implementations

impl Parser

fn new() -> Parser

Create a new parser with a default configuration.

The parser can be run with either the parse or parse_with_comments methods. The parse methods return an abstract syntax tree.

To set configuration options on the parser, use ParserBuilder.

fn parse(self: &mut Self, pattern: &str) -> Result<Ast, Error>

Parse the regular expression into an abstract syntax tree.

fn parse_with_comments(self: &mut Self, pattern: &str) -> Result<WithComments, Error>

Parse the regular expression and return an abstract syntax tree with all of the comments found in the pattern.

impl Clone for Parser

fn clone(self: &Self) -> Parser

impl Debug for Parser

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

impl Freeze for Parser

impl RefUnwindSafe for Parser

impl Send for Parser

impl Sync for Parser

impl Unpin for Parser

impl UnsafeUnpin for Parser

impl UnwindSafe for Parser

impl<T> Any for Parser

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Parser

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Parser

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

impl<T> CloneToUninit for Parser

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Parser

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Parser

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Parser

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Parser

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

impl<T, U> TryInto for Parser

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