pub struct Builder<T, F: FnOnce(&mut LexicalContext) -> ParseResult<T>> { /* private fields */ }
Expand description
An AST DSL helper to enable Program::try_from(with(|ctx| Ok(...)))
via with
Trait Implementations
sourceimpl<T, F> TryFrom<Builder<T, F>> for Program where
Statement: From<T>,
F: FnOnce(&mut LexicalContext) -> ParseResult<T>,
impl<T, F> TryFrom<Builder<T, F>> for Program where
Statement: From<T>,
F: FnOnce(&mut LexicalContext) -> ParseResult<T>,
type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
sourcefn try_from(builder: Builder<T, F>) -> Result<Self, ParseError>
fn try_from(builder: Builder<T, F>) -> Result<Self, ParseError>
Performs the conversion.
sourceimpl<F> TryFrom<Builder<Vec<Statement, Global>, F>> for Program where
F: FnOnce(&mut LexicalContext) -> ParseResult<Vec<Statement>>,
impl<F> TryFrom<Builder<Vec<Statement, Global>, F>> for Program where
F: FnOnce(&mut LexicalContext) -> ParseResult<Vec<Statement>>,
type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
sourcefn try_from(builder: BlockBuilder<F>) -> Result<Self, ParseError>
fn try_from(builder: BlockBuilder<F>) -> Result<Self, ParseError>
Performs the conversion.
Auto Trait Implementations
impl<T, F> RefUnwindSafe for Builder<T, F> where
F: RefUnwindSafe,
impl<T, F> Send for Builder<T, F> where
F: Send,
impl<T, F> Sync for Builder<T, F> where
F: Sync,
impl<T, F> Unpin for Builder<T, F> where
F: Unpin,
impl<T, F> UnwindSafe for Builder<T, F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more