[][src]Crate syn_mid

Providing the features between "full" and "derive" of syn.

This crate provides the following two unique data structures.

  • syn_mid::ItemFn -- A function whose body is not parsed.

    fn process(n: usize) -> Result<()> { ... }
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^     ^
    
  • syn_mid::Block -- A block whose body is not parsed.

    { ... }
    ^     ^
    

Other data structures are the same as data structures of syn. These are defined in this crate because they cannot be used in syn without "full" feature.

Optional features

  • clone-impls — Clone impls for all syntax tree types.

Structs

Block

A braced block containing Rust statements.

FieldPat

A single field in a struct pattern.

ItemFn

A free-standing function: fn process(n: usize) -> Result<()> { ... }.

PatIdent

A pattern that binds a new variable: ref mut binding @ SUBPATTERN.

PatPath

A path pattern like Color::Red.

PatReference

A reference pattern: &mut var.

PatStruct

A struct or struct variant pattern: Variant { x, y, .. }.

PatTuple

A tuple pattern: (a, b).

PatTupleStruct

A tuple struct or tuple variant pattern: Variant(x, y, .., z).

PatType

A type ascription pattern: foo: f64.

PatWild

A pattern that matches any value: _.

Receiver

The self argument of an associated method, whether taken by value or by reference.

Signature

A function signature in a trait or implementation: unsafe fn initialize(&self).

Enums

FnArg

An argument in a function signature: the n: usize in fn f(n: usize).

Pat

A pattern in a local binding, function signature, match expression, or various other places.