Expand description
Declarative parsing types using unsynn
Structs§
- Angle
Token Tree - Parses either a
TokenTreeor<...>grouping - Attribute
- (Outer) Attribute like #[derive(Debug)]
- CfgAttr
Arg - Name argument: name = “custom”
- Const
Sig - const NAME: Type = value;
- EnumSig
- enum Name { … } block
- Enum
Variant - Single enum variant
- Extern
With Abi - Extern with ABI string
- FnSig
- Complete function signature
- Generics
- Simple generics (treat as opaque for now)
- Impl
Block Sig - impl Type { … } block
- Inner
Attribute - Inner attribute like #![forbid(unsafe_code)]
- KAsync
- The “async” keyword
- KCfg
Attr - The “cfg_attr” keyword
- KConst
- The “const” keyword
- KCrate
- The “crate” keyword
- KEnum
- The “enum” keyword
- KExtern
- The “extern” keyword
- KFn
- The “fn” keyword
- KFor
- The “for” keyword
- KImpl
- The “impl” keyword
- KMod
- The “mod” keyword
- KMut
- The “mut” keyword
- KName
- The “name” keyword
- KPath
- The “path” keyword
- KPub
- The “pub” keyword
- KSelf
- The “self” keyword
- KStatic
- The “static” keyword
- KStruct
- The “struct” keyword
- KSuper
- The “super” keyword
- KTrait
- The “trait” keyword
- KType
- The “type” keyword
- KUnsafe
- The “unsafe” keyword
- KWhere
- The “where” keyword
- Module
Content - A complete module/file content
- Module
Sig - mod name { … } block
- NameArg
- Name argument: name = “custom”
- Named
Param - name: Type parameter
- PathArg
- Path argument: path = “docs”
- Pattern
Param - Pattern parameter like (a, b): (i32, i32) or mut (x, y): Point
- Restricted
Vis - Restricted visibility like pub(crate)
- Return
Type Fn - Function return type: -> Type (stops at {)
- Return
Type Trait - Trait return type: -> Type (stops at ;)
- Static
Sig - static NAME: Type = value;
- Struct
Field - Named struct field: pub name: Type
- Struct
Sig - struct Name { … } or struct Name;
- Sync
DocInner - Declarative syncdoc arguments structure
- Trait
Method Sig - Trait method signature (no body)
- Trait
Sig - trait Name { … } block
- Tuple
Pattern - Tuple destructuring pattern: (a, b, c)
- Type
Alias Sig - type Alias = Type;
- Where
Clause - Represents a single predicate within a
whereclause. - Where
Clause Predicate - Single where clause predicate: T: Trait
- Where
Clauses - Where clauses: where T: Trait, U: Send
Enums§
- AnyAttribute
- Either an inner or outer attribute
- Enum
Variant Data - Enum variant data
- Extern
Spec - Extern specification with optional ABI
- FnParam
- Function parameter: name: Type or self variants
- Module
Item - Top-level item that can appear in a module
- Pattern
- Different types of patterns
- Pattern
Field - Field in a pattern
- Self
Param - self, &self, &mut self, mut self
- Struct
Body - Struct body variants
- Sync
DocArg - Single syncdoc argument
- Visibility
- Simple visibility parsing
Type Aliases§
- And
- The “&” operator
- Eq
- The “=” operator
- Verbatim
Until - Parses tokens until
Cis found on the current token tree level.