Expand description
A library for stripping raw prefixes from syn objects.
This library provides utilities to read syn objects like Ident and Path
and strip raw identifier prefixes (the r# prefix used for raw identifiers in Rust).
§Examples
use syn::Ident;
use desynt::StripRaw;
let ident: Ident = syn::parse_str("r#type").unwrap();
let stripped = ident.strip_raw();
assert_eq!(stripped.to_string(), "type");Modules§
- utils
- Utility functions for working with raw identifiers.
Structs§
- Empty
Storage - Empty storage for when no custom mappings are needed
- Path
Resolver
Constants§
- EMPTY_
RESOLVER - A const empty path resolver.
- PRIMITIVE_
RESOLVER - A const path resolver with primitive type mappings.
Traits§
- HasRaw
- A trait for checking if a syn object has raw prefixes.
- Mapping
Storage - A trait for mapping storage that can be used with PathResolver.
- Strip
Raw - A trait for stripping raw prefixes from syn objects.
Functions§
- create_
static_ resolver - Example function for creating a static resolver with custom PHF mappings
Type Aliases§
- Dynamic
Path Resolver - Type alias for dynamic path resolvers using HashMap
- Primitive
Path Resolver - Type alias for const path resolvers with only primitive mappings
- Static
Path Resolver - Type alias for static path resolvers using PHF Map