GrammarProc

Struct GrammarProc 

Source
pub struct GrammarProc<PN: Eq + Hash + Copy + Debug + Display, TN: PartialEq + Copy + Display> { /* private fields */ }
Expand description

A procedure definition in a grammar.

GrammarProcs shouldn’t be created independently from a Grammar. If you want to create a Grammar dynamically instead of using the crate::grammar macro, use crate::parse::GrammarBuilder instead.

Implementations§

Source§

impl<PN: Eq + Hash + Copy + Debug + Display, TN: PartialEq + Copy + Display> GrammarProc<PN, TN>

Source

pub fn new(name: PN, graph: MatchGraph<GrammarItemName<PN, TN>>) -> Self

Trait Implementations§

Source§

impl<PN: Debug + Eq + Hash + Copy + Debug + Display, TN: Debug + PartialEq + Copy + Display> Debug for GrammarProc<PN, TN>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<PN, TN> Freeze for GrammarProc<PN, TN>
where PN: Freeze,

§

impl<PN, TN> RefUnwindSafe for GrammarProc<PN, TN>

§

impl<PN, TN> Send for GrammarProc<PN, TN>
where PN: Send, TN: Send,

§

impl<PN, TN> Sync for GrammarProc<PN, TN>
where PN: Sync, TN: Sync,

§

impl<PN, TN> Unpin for GrammarProc<PN, TN>
where PN: Unpin, TN: Unpin,

§

impl<PN, TN> UnwindSafe for GrammarProc<PN, TN>
where PN: UnwindSafe, TN: 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<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.
Source§

impl<T> TupleTree<T, ()> for T

Source§

const SIZE: Size

Source§

fn descendants(_indirect_level: usize) -> usize

Source§

fn height() -> usize

Source§

fn preorder(self, f: &mut impl FnMut(Visit<T>))

Source§

fn preorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))

Source§

fn postorder(self, f: &mut impl FnMut(Visit<T>))

Source§

fn postorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))