Struct rustc_expand::base::MacEager

source ·
pub struct MacEager {
    pub expr: Option<P<Expr>>,
    pub pat: Option<P<Pat>>,
    pub items: Option<SmallVec<[P<Item>; 1]>>,
    pub impl_items: Option<SmallVec<[P<AssocItem>; 1]>>,
    pub trait_items: Option<SmallVec<[P<AssocItem>; 1]>>,
    pub foreign_items: Option<SmallVec<[P<ForeignItem>; 1]>>,
    pub stmts: Option<SmallVec<[Stmt; 1]>>,
    pub ty: Option<P<Ty>>,
}
Expand description

MacResult implementation for the common case where you’ve already built each form of AST that you might return.

Fields§

§expr: Option<P<Expr>>§pat: Option<P<Pat>>§items: Option<SmallVec<[P<Item>; 1]>>§impl_items: Option<SmallVec<[P<AssocItem>; 1]>>§trait_items: Option<SmallVec<[P<AssocItem>; 1]>>§foreign_items: Option<SmallVec<[P<ForeignItem>; 1]>>§stmts: Option<SmallVec<[Stmt; 1]>>§ty: Option<P<Ty>>

Implementations§

Trait Implementations§

Returns the “default value” for a type. Read more
Creates an expression.
Creates zero or more items.
Creates zero or more impl items.
Creates zero or more trait items.
Creates zero or more items in an extern {} block
Creates zero or more statements. Read more
Creates a pattern.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 200 bytes