Crate desynt

Crate desynt 

Source
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§

EmptyStorage
Empty storage for when no custom mappings are needed
PathResolver

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.
MappingStorage
A trait for mapping storage that can be used with PathResolver.
StripRaw
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§

DynamicPathResolver
Type alias for dynamic path resolvers using HashMap
PrimitivePathResolver
Type alias for const path resolvers with only primitive mappings
StaticPathResolver
Type alias for static path resolvers using PHF Map