[−][src]Enum syntex_syntax2::ast::ItemKind
Variants
ExternCrate(Option<Name>)
Anextern crate
item, with optional original crate name.
E.g. extern crate foo
or extern crate foo_bar as foo
Use(P<ViewPath>)
A use declaration (use
or pub use
) item.
E.g. use foo;
, use foo::bar;
or use foo::bar as FooBar;
Static(P<Ty>, Mutability, P<Expr>)
A static item (static
or pub static
).
E.g. static FOO: i32 = 42;
or static FOO: &'static str = "bar";
Const(P<Ty>, P<Expr>)
A constant item (const
or pub const
).
E.g. const FOO: i32 = 42;
Fn(P<FnDecl>, Unsafety, Spanned<Constness>, Abi, Generics, P<Block>)
A function declaration (fn
or pub fn
).
E.g. fn foo(bar: usize) -> usize { .. }
Mod(Mod)
A module declaration (mod
or pub mod
).
E.g. mod foo;
or mod foo { .. }
ForeignMod(ForeignMod)
An external module (extern
or pub extern
).
E.g. extern {}
or extern "C" {}
GlobalAsm(P<GlobalAsm>)
Module-level inline assembly (from global_asm!()
)
Ty(P<Ty>, Generics)
A type alias (type
or pub type
).
E.g. type Foo = Bar<u8>;
Enum(EnumDef, Generics)
An enum definition (enum
or pub enum
).
E.g. enum Foo<A, B> { C<A>, D<B> }
Struct(VariantData, Generics)
A struct definition (struct
or pub struct
).
E.g. struct Foo<A> { x: A }
Union(VariantData, Generics)
A union definition (union
or pub union
).
E.g. union Foo<A, B> { x: A, y: B }
Trait(Unsafety, Generics, TyParamBounds, Vec<TraitItem>)
A Trait declaration (trait
or pub trait
).
E.g. trait Foo { .. }
or trait Foo<T> { .. }
DefaultImpl(Unsafety, TraitRef)
E.g. impl Trait for .. {}
or impl<T> Trait<T> for .. {}
Impl(Unsafety, ImplPolarity, Defaultness, Generics, Option<TraitRef>, P<Ty>, Vec<ImplItem>)
An implementation.
E.g. impl<A> Foo<A> { .. }
or impl<A> Trait for Foo<A> { .. }
Mac(Mac)
A macro invocation.
E.g. macro_rules! foo { .. }
or foo!(..)
MacroDef(MacroDef)
A macro definition.
Methods
impl ItemKind
[src]
pub fn descriptive_variant(&self) -> &str
[src]
Trait Implementations
impl Clone for ItemKind
[src]
fn clone(&self) -> ItemKind
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for ItemKind
[src]
impl PartialEq<ItemKind> for ItemKind
[src]
impl Hash for ItemKind
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for ItemKind
[src]
impl<'de> Deserialize<'de> for ItemKind
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for ItemKind
[src]
Auto Trait Implementations
impl !Sync for ItemKind
impl Unpin for ItemKind
impl !Send for ItemKind
impl !UnwindSafe for ItemKind
impl !RefUnwindSafe for ItemKind
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,