Expand description
Shared parsing utilities for server-less proc macros.
This crate provides common types and functions for extracting method information from impl blocks.
Internal API. This crate exists to support the server-less proc macros
and is published only because path dependencies are disallowed. Its surface is
typed in terms of syn / proc-macro2 and carries no stability guarantees;
depend on the server-less facade instead.
Structs§
- Group
Registry - Registry of declared method groups from
#[server(groups(...))]. - Method
Info - Parsed method information with full
synAST types. - Param
Info - Parsed parameter information
- Parsed
Param Attrs - Parsed result of
#[param(...)]attributes. - Partitioned
Methods - Categorized methods for code generation.
- Return
Info - Parsed return type information
Enums§
- Http
Method - Compile-time HTTP method enum used by proc macros during code generation.
- Param
Location - Parameter location for HTTP requests
Functions§
- did_
you_ mean - Return the closest candidate to
inputwithin edit distance ≤ 2, orNone. - extract_
docs - Extract doc comments from attributes
- extract_
groups - Extract the group registry from
#[server(groups(...))]on an impl block. - extract_
iterator_ item - Check if a type is impl Iterator<Item=T> and extract T
- extract_
map_ type - Check if a type is
HashMap<K, V>orBTreeMap<K, V>and extract K and V - extract_
methods - Extract all methods from an impl block
- extract_
option_ type - Check if a type is
Option<T>and extract T - extract_
result_ types - Check if a type is Result<T, E> and extract T and E
- extract_
stream_ item - Check if a type is impl Stream<Item=T> and extract T
- extract_
vec_ type - Check if a type is
Vec<T>and extract T - get_
impl_ name - Get the struct name from an impl block
- ident_
str - Convert an identifier to a string, stripping the
r#prefix for raw identifiers. - is_
bool_ type - Check if a type is
bool - is_
id_ param - Check if a parameter name looks like an ID
- is_
option_ type - Check if a type is
Option<T> - is_
unit_ type - Check if a type is ()
- levenshtein
- Compute Levenshtein edit distance between two strings.
- parse_
param_ attrs - Parse #[param(…)] attributes from a parameter
- parse_
params - Parse function parameters (excluding self)
- parse_
return_ type - Parse return type information
- partition_
methods - Partition methods into leaf commands, static mounts, and slug mounts.
- resolve_
method_ group - Resolve a method’s group against the registry.
- unwrap_
option_ type - If
tyisOption<T>, returnsSome(&T). Otherwise returnsNone. - unwrap_
result_ ok_ type - If
tyisResult<T, E>, returnsSome(&T). Otherwise returnsNone. - unwrap_
vec_ type - If
tyisVec<T>, returnsSome(&T). Otherwise returnsNone.