Enum rustc_expand::expand::AstFragment [−][src]
pub enum AstFragment {
Show 16 variants
OptExpr(Option<P<Expr>>),
Expr(P<Expr>),
Pat(P<Pat>),
Ty(P<Ty>),
Stmts(SmallVec<[Stmt; 1]>),
Items(SmallVec<[P<Item>; 1]>),
TraitItems(SmallVec<[P<AssocItem>; 1]>),
ImplItems(SmallVec<[P<AssocItem>; 1]>),
ForeignItems(SmallVec<[P<ForeignItem>; 1]>),
Arms(SmallVec<[Arm; 1]>),
Fields(SmallVec<[ExprField; 1]>),
FieldPats(SmallVec<[PatField; 1]>),
GenericParams(SmallVec<[GenericParam; 1]>),
Params(SmallVec<[Param; 1]>),
StructFields(SmallVec<[FieldDef; 1]>),
Variants(SmallVec<[Variant; 1]>),
}
Expand description
A fragment of AST that can be produced by a single macro expansion. Can also serve as an input and intermediate result for macro expansion operations.
Variants
ForeignItems(SmallVec<[P<ForeignItem>; 1]>)
Tuple Fields of ForeignItems
0: SmallVec<[P<ForeignItem>; 1]>
GenericParams(SmallVec<[GenericParam; 1]>)
Tuple Fields of GenericParams
Implementations
Auto Trait Implementations
impl !RefUnwindSafe for AstFragment
impl !Send for AstFragment
impl !Sync for AstFragment
impl Unpin for AstFragment
impl !UnwindSafe for AstFragment
Blanket Implementations
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: 136 bytes
Size for each variant:
OptExpr
: 8 bytesExpr
: 8 bytesPat
: 8 bytesTy
: 8 bytesStmts
: 40 bytesItems
: 24 bytesTraitItems
: 24 bytesImplItems
: 24 bytesForeignItems
: 24 bytesArms
: 56 bytesFields
: 56 bytesFieldPats
: 56 bytesGenericParams
: 104 bytesParams
: 48 bytesStructFields
: 88 bytesVariants
: 128 bytes