pub struct Binding<L: Language> {
pub name: String,
pub bound_var: CoreBoundVar<L>,
}
Expand description
Records a single binding, used when parsing [Binder
].
Fields§
§name: String
Name the user during during parsing
bound_var: CoreBoundVar<L>
The bound var representation.
Trait Implementations§
Source§impl<L: Language> CoreParse<L> for Binding<L>
Binding grammar is $kind $name
, e.g., ty Foo
.
impl<L: Language> CoreParse<L> for Binding<L>
Binding grammar is $kind $name
, e.g., ty Foo
.
Source§fn parse<'t>(scope: &Scope<L>, text: &'t str) -> ParseResult<'t, Self>
fn parse<'t>(scope: &Scope<L>, text: &'t str) -> ParseResult<'t, Self>
Parse a single instance of this type, returning an error if no such
instance is present.
Source§fn parse_many<'t>(
scope: &Scope<L>,
text: &'t str,
close_char: char,
) -> ParseResult<'t, Vec<Self>>
fn parse_many<'t>( scope: &Scope<L>, text: &'t str, close_char: char, ) -> ParseResult<'t, Vec<Self>>
Parse many instances of self, expecting
close_char
to appear after the last instance
(close_char
is not consumed).Source§fn parse_comma<'t>(
scope: &Scope<L>,
text: &'t str,
close_char: char,
) -> ParseResult<'t, Vec<Self>>
fn parse_comma<'t>( scope: &Scope<L>, text: &'t str, close_char: char, ) -> ParseResult<'t, Vec<Self>>
Comma separated list with optional trailing comma.
Auto Trait Implementations§
impl<L> Freeze for Binding<L>
impl<L> RefUnwindSafe for Binding<L>
impl<L> Send for Binding<L>
impl<L> Sync for Binding<L>
impl<L> Unpin for Binding<L>
impl<L> UnwindSafe for Binding<L>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more