pub enum AstTarget<'a> {
Show 37 variants
Delegation,
MacroCall,
AssocConst(&'a ConstItem),
Method(&'a Fn),
AssocTy(&'a TyAlias),
ForeignStatic(&'a StaticItem),
ForeignFn(&'a Fn),
ForeignTy(&'a TyAlias),
ExternCrate(&'a Option<Symbol>, &'a Ident),
Use(&'a UseTree),
Static(&'a StaticItem),
Const(ConstTypeAstTarget<'a>),
Fn(&'a Fn),
Mod(&'a Safety, &'a Ident, &'a ModKind),
ForeignMod(&'a ForeignMod),
GlobalAsm(&'a InlineAsm),
TyAlias(&'a TyAlias),
Enum(&'a Ident, &'a Generics, &'a EnumDef),
Struct(&'a Ident, &'a Generics, &'a VariantData),
Union(&'a Ident, &'a Generics, &'a VariantData),
Trait(&'a Trait),
TraitAlias(&'a TraitAlias),
Impl(&'a Impl),
MacroDef(&'a Ident, &'a MacroDef),
Closure(&'a Closure),
Expression(&'a Expr),
Arm(&'a Arm),
Crate(&'a Crate),
ExprField(&'a ExprField),
Field(&'a FieldDef),
GenericParam(&'a GenericParam),
Param(&'a Param),
Pat(&'a Pat),
Statement(&'a Stmt),
Variant(&'a Variant),
WherePredicate(&'a WherePredicate),
None,
}Expand description
This enum lists all possible types of AST items.
Variants§
Delegation
MacroCall
AssocConst(&'a ConstItem)
Method(&'a Fn)
AssocTy(&'a TyAlias)
ForeignStatic(&'a StaticItem)
ForeignFn(&'a Fn)
ForeignTy(&'a TyAlias)
ExternCrate(&'a Option<Symbol>, &'a Ident)
Use(&'a UseTree)
Static(&'a StaticItem)
Const(ConstTypeAstTarget<'a>)
Fn(&'a Fn)
Mod(&'a Safety, &'a Ident, &'a ModKind)
ForeignMod(&'a ForeignMod)
GlobalAsm(&'a InlineAsm)
TyAlias(&'a TyAlias)
Enum(&'a Ident, &'a Generics, &'a EnumDef)
Struct(&'a Ident, &'a Generics, &'a VariantData)
Union(&'a Ident, &'a Generics, &'a VariantData)
Trait(&'a Trait)
TraitAlias(&'a TraitAlias)
Impl(&'a Impl)
MacroDef(&'a Ident, &'a MacroDef)
Closure(&'a Closure)
Expression(&'a Expr)
Arm(&'a Arm)
Crate(&'a Crate)
ExprField(&'a ExprField)
Field(&'a FieldDef)
GenericParam(&'a GenericParam)
Param(&'a Param)
Pat(&'a Pat)
Statement(&'a Stmt)
Variant(&'a Variant)
WherePredicate(&'a WherePredicate)
None
Implementations§
Source§impl<'a> AstTarget<'a>
impl<'a> AstTarget<'a>
pub fn get_abi(&self) -> Option<ExternAbi>
pub fn get_fn_sig(&self) -> Option<&FnSig>
pub fn from_foreign_item_kind(kind: &'a ForeignItemKind) -> Self
pub fn from_assoc_item_kind(kind: &'a AssocItemKind) -> Self
pub fn from_ast_item(kind: &'a ItemKind) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<'a> DynSend for AstTarget<'a>
impl<'a> DynSync for AstTarget<'a>
impl<'a> Freeze for AstTarget<'a>
impl<'a> RefUnwindSafe for AstTarget<'a>
impl<'a> Send for AstTarget<'a>
impl<'a> Sync for AstTarget<'a>
impl<'a> Unpin for AstTarget<'a>
impl<'a> UnsafeUnpin for AstTarget<'a>
impl<'a> UnwindSafe for AstTarget<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
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: 32 bytes
Size for each variant:
Delegation: 0 bytesMacroCall: 0 bytesAssocConst: 8 bytesMethod: 8 bytesAssocTy: 8 bytesForeignStatic: 8 bytesForeignFn: 8 bytesForeignTy: 8 bytesExternCrate: 16 bytesUse: 8 bytesStatic: 8 bytesConst: 16 bytesFn: 8 bytesMod: 24 bytesForeignMod: 8 bytesGlobalAsm: 8 bytesTyAlias: 8 bytesEnum: 24 bytesStruct: 24 bytesUnion: 24 bytesTrait: 8 bytesTraitAlias: 8 bytesImpl: 8 bytesMacroDef: 16 bytesClosure: 8 bytesExpression: 8 bytesArm: 8 bytesCrate: 8 bytesExprField: 8 bytesField: 8 bytesGenericParam: 8 bytesParam: 8 bytesPat: 8 bytesStatement: 8 bytesVariant: 8 bytesWherePredicate: 8 bytesNone: 0 bytes