Skip to main content

Module types

Module types 

Source
Expand description

AST-based type analysis utilities.

All wrapper extraction operates on syn::Type AST nodes by checking the final path segment ident — never on a string representation of the type. This means Json<T>, axum::Json<T>, and axum::extract::Json<T> are all matched identically.

Structs§

WrapperMatch
The generic argument list of a matched wrapper type.

Constants§

HASHMAP
JSON
OPTION
PATH
QUERY
RESULT
SSE
STATE
STATUSCODE
VEC

Functions§

extract_first_generic_arg_string
Extract the first generic argument from a type string.
extract_wrapper
Extract the generic arguments of wrapper_name<...> from ty, or return a structured error if the wrapper is not present or has no type arguments.
innermost_custom_type
Recursively unwrap well-known wrappers and return the innermost type.
is_primitive
Returns true for Rust primitive types and the unit type ().
is_primitive_type_name
Check if a type name string represents a Rust primitive or standard type.
last_ident_matches
Check if the last path segment ident matches the given name.
try_extract_wrapper
Extract the generic arguments of wrapper_name<...> from ty.