pub struct Alternative {
pub expr: Expr,
pub alias: Option<Name>,
pub builder: Option<ValueBuilder>,
}Expand description
A top-level alternative of a rule or a level, with its alias and value builder.
Fields§
§expr: ExprWhat the alternative matches.
alias: Option<Name>-> name: the kind of node the alternative produces.
builder: Option<ValueBuilder>=> builder: how a transform turns the node into a value.
Implementations§
Source§impl Alternative
impl Alternative
Sourcepub fn alias(self, name: &str) -> Alternative
pub fn alias(self, name: &str) -> Alternative
Name the node this alternative produces.
Trait Implementations§
Source§impl Clone for Alternative
impl Clone for Alternative
Source§impl Debug for Alternative
impl Debug for Alternative
Source§impl PartialEq for Alternative
impl PartialEq for Alternative
impl StructuralPartialEq for Alternative
Auto Trait Implementations§
impl Forget for Alternative
impl Freeze for Alternative
impl Move for Alternative
impl RefUnwindSafe for Alternative
impl Send for Alternative
impl Sync for Alternative
impl Unpin for Alternative
impl UnsafeUnpin for Alternative
impl UnwindSafe for Alternative
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