Struct Printer

struct Printer { ... }

A printer for a regular expression abstract syntax tree.

A printer converts an abstract syntax tree (AST) to a regular expression pattern string. This particular printer uses constant stack space and heap space proportional to the size of the AST.

This printer will not necessarily preserve the original formatting of the regular expression pattern string. For example, all whitespace and comments are ignored.

Implementations

impl Printer

fn new() -> Printer

Create a new printer.

fn print<W: fmt::Write>(self: &mut Self, ast: &Ast, wtr: W) -> Result

Print the given Ast to the given writer. The writer must implement fmt::Write. Typical implementations of fmt::Write that can be used here are a fmt::Formatter (which is available in fmt::Display implementations) or a &mut String.

impl Debug for Printer

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

impl Freeze for Printer

impl RefUnwindSafe for Printer

impl Send for Printer

impl Sync for Printer

impl Unpin for Printer

impl UnsafeUnpin for Printer

impl UnwindSafe for Printer

impl<T> Any for Printer

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Printer

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

impl<T> BorrowMut for Printer

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

impl<T> From for Printer

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Printer

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 Printer

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

impl<T, U> TryInto for Printer

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