syn

Module item

source

Modules§

Structs§

  • A foreign function in an extern block.
  • A macro invocation within an extern block.
  • A foreign static item in an extern block: static ext: u8.
  • A foreign type in an extern block: type void.
  • An associated constant within an impl block.
  • An associated function within an impl block.
  • A macro invocation within an impl block.
  • An associated type within an impl block.
  • A constant item: const MAX: u16 = 65535.
  • An enum definition: enum Foo<A, B> { A(A), B(B) }.
  • An extern crate item: extern crate serde.
  • A free-standing function: fn process(n: usize) -> Result<()> { ... }.
  • A block of foreign items: extern "C" { ... }.
  • An impl block providing trait or associated items: impl<A> Trait for Data<A> { ... }.
  • A macro invocation, which includes macro_rules! definitions.
  • A module or module declaration: mod m or mod m { ... }.
  • A static item: static BIKE: Shed = Shed(42).
  • A struct definition: struct Foo<A> { x: A }.
  • A trait definition: pub trait Iterator { ... }.
  • A trait alias: pub trait SharableIterator = Iterator + Sync.
  • A type alias: type Result<T> = std::result::Result<T, MyError>.
  • A union definition: union Foo<A, B> { x: A, y: B }.
  • A use declaration: use std::collections::HashMap.
  • The self argument of an associated method.
  • A function signature in a trait or implementation: unsafe fn initialize(&self).
  • An associated constant within the definition of a trait.
  • An associated function within the definition of a trait.
  • A macro invocation within the definition of a trait.
  • An associated type within the definition of a trait.
  • A glob import in a use item: *.
  • A braced group of imports in a use item: {A, B, C}.
  • An identifier imported by a use item: HashMap.
  • A path prefix of imports in a use item: std::....
  • An renamed identifier imported by a use item: HashMap as Map.
  • The variadic argument of a foreign function.

Enums§

  • An argument in a function signature: the n: usize in fn f(n: usize).
  • An item within an extern block.
  • An item within an impl block.
  • Unused, but reserved for RFC 3323 restrictions.
  • Things that can appear directly inside of a module or scope.
  • The mutability of an Item::Static or ForeignItem::Static.
  • An item declaration within the definition of a trait.
  • A suffix of an import tree in a use item: Type as Renamed or *.