Trait syntax::ext::base::MacResultUnstable [-] [+] [src]

pub trait MacResult {
    fn make_expr(self: Box<Self>) -> Option<P<Expr>> { ... }
    fn make_items(self: Box<Self>) -> Option<SmallVector<P<Item>>> { ... }
    fn make_methods(self: Box<Self>) -> Option<SmallVector<P<Method>>> { ... }
    fn make_pat(self: Box<Self>) -> Option<P<Pat>> { ... }
    fn make_stmt(self: Box<Self>) -> Option<P<Stmt>> { ... }
}

The result of a macro expansion. The return values of the various methods are spliced into the AST at the callsite of the macro (or just into the compiler's internal macro table, for make_def).

Provided Methods

fn make_expr(self: Box<Self>) -> Option<P<Expr>>

Create an expression.

fn make_items(self: Box<Self>) -> Option<SmallVector<P<Item>>>

Create zero or more items.

fn make_methods(self: Box<Self>) -> Option<SmallVector<P<Method>>>

Create zero or more methods.

fn make_pat(self: Box<Self>) -> Option<P<Pat>>

Create a pattern.

fn make_stmt(self: Box<Self>) -> Option<P<Stmt>>

Create a statement.

By default this attempts to create an expression statement, returning None if that fails.

Implementors