rustc_expand::base

Trait MacResult

Source
pub trait MacResult {
Show 16 methods // Provided methods fn make_expr(self: Box<Self>) -> Option<P<Expr>> { ... } fn make_items(self: Box<Self>) -> Option<SmallVec<[P<Item>; 1]>> { ... } fn make_impl_items(self: Box<Self>) -> Option<SmallVec<[P<AssocItem>; 1]>> { ... } fn make_trait_items(self: Box<Self>) -> Option<SmallVec<[P<AssocItem>; 1]>> { ... } fn make_foreign_items( self: Box<Self>, ) -> Option<SmallVec<[P<ForeignItem>; 1]>> { ... } fn make_pat(self: Box<Self>) -> Option<P<Pat>> { ... } fn make_stmts(self: Box<Self>) -> Option<SmallVec<[Stmt; 1]>> { ... } fn make_ty(self: Box<Self>) -> Option<P<Ty>> { ... } fn make_arms(self: Box<Self>) -> Option<SmallVec<[Arm; 1]>> { ... } fn make_expr_fields(self: Box<Self>) -> Option<SmallVec<[ExprField; 1]>> { ... } fn make_pat_fields(self: Box<Self>) -> Option<SmallVec<[PatField; 1]>> { ... } fn make_generic_params( self: Box<Self>, ) -> Option<SmallVec<[GenericParam; 1]>> { ... } fn make_params(self: Box<Self>) -> Option<SmallVec<[Param; 1]>> { ... } fn make_field_defs(self: Box<Self>) -> Option<SmallVec<[FieldDef; 1]>> { ... } fn make_variants(self: Box<Self>) -> Option<SmallVec<[Variant; 1]>> { ... } fn make_crate(self: Box<Self>) -> Option<Crate> { ... }
}
Expand description

The result of a macro expansion. The return values of the various methods are spliced into the AST at the callsite of the macro.

Provided Methods§

Source

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

Creates an expression.

Source

fn make_items(self: Box<Self>) -> Option<SmallVec<[P<Item>; 1]>>

Creates zero or more items.

Source

fn make_impl_items(self: Box<Self>) -> Option<SmallVec<[P<AssocItem>; 1]>>

Creates zero or more impl items.

Source

fn make_trait_items(self: Box<Self>) -> Option<SmallVec<[P<AssocItem>; 1]>>

Creates zero or more trait items.

Source

fn make_foreign_items(self: Box<Self>) -> Option<SmallVec<[P<ForeignItem>; 1]>>

Creates zero or more items in an extern {} block

Source

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

Creates a pattern.

Source

fn make_stmts(self: Box<Self>) -> Option<SmallVec<[Stmt; 1]>>

Creates zero or more statements.

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

Source

fn make_ty(self: Box<Self>) -> Option<P<Ty>>

Source

fn make_arms(self: Box<Self>) -> Option<SmallVec<[Arm; 1]>>

Source

fn make_expr_fields(self: Box<Self>) -> Option<SmallVec<[ExprField; 1]>>

Source

fn make_pat_fields(self: Box<Self>) -> Option<SmallVec<[PatField; 1]>>

Source

fn make_generic_params(self: Box<Self>) -> Option<SmallVec<[GenericParam; 1]>>

Source

fn make_params(self: Box<Self>) -> Option<SmallVec<[Param; 1]>>

Source

fn make_field_defs(self: Box<Self>) -> Option<SmallVec<[FieldDef; 1]>>

Source

fn make_variants(self: Box<Self>) -> Option<SmallVec<[Variant; 1]>>

Source

fn make_crate(self: Box<Self>) -> Option<Crate>

Implementors§