Expand description
§Deluxe Core
Core functions and traits shared between deluxe and
deluxe_macros.
This crate is used by deluxe_macros to parse its own
attributes. Code generated by its derive macros also references items from this crate
re-exported into deluxe. The functions in parse_helpers are used
internally by the derive macros, but can also be used for convenience when manually
implementing any of the parsing traits.
See the documentation for the deluxe crate for a high-level overview
of how Deluxe works.
Modules§
- parse_
helpers - Utility functions for parse trait implementations.
- validations
- Additional helper functions for validating after parsing.
- with
- Custom parsing helpers for
#[deluxe(with = ...)].
Macros§
- all_
or_ none - Appends an error if some attributes are present, but not all of them, automatically casting and stringifying field names.
- define_
with_ collection - Generates a module for parsing a collection using `#[deluxe(with = …)].
- define_
with_ map - Generates a module for parsing a map collection using `#[deluxe(with = …)].
- define_
with_ optional - Generates a module for parsing an optional value using `#[deluxe(with = …)].
- only_
one - Appends an error if more than one given attribute is present, automatically casting and stringifying field names.
- parse_
named_ meta_ item_ with - Parses a
ParseMetaItemfollowing a name, using a custom parse module.
Structs§
- Errors
- A wrapper for a list of errors. Can be empty.
- Errors
Into Iter - An iterator containing all the errors in an
Errors. - Flag
- A value for a boolean named field that can only be a name (set) or omitted (unset).
- Span
- A region of source code, along with macro expansion information.
- Spanned
Value - A wrapper for adding a
Spanto an arbitrary value.
Enums§
- Parse
Mode - The context a meta item parser is operating in.
Traits§
- Container
From - Converts a
HasAttributestype to a stored container value. - Extract
Attributes - Extracts a structure out of a
syn::Attributelist. - HasAttributes
- Trait for a
syntype containing a list of attributes. - Parse
Attributes - Parses a structure out of a
syn::Attributelist. - Parse
Meta Append - Parses a meta item for a structure with named fields that concatenates all matching items.
- Parse
Meta Flat Named - Parses a meta item for a structure with named fields.
- Parse
Meta Flat Unnamed - Parses a meta item for a structure with unnamed fields.
- Parse
Meta Item - Base trait for parsing a single field out of
syn::parse::ParseStream. - Parse
Meta Rest - Parses a meta item for a structure with named fields that consumes all fields.
- ToKey
String - A trait for converting an attribute key to a string.