Crate deluxe_core

Crate deluxe_core 

Source
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 ParseMetaItem following a name, using a custom parse module.

Structs§

Errors
A wrapper for a list of errors. Can be empty.
ErrorsIntoIter
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.
SpannedValue
A wrapper for adding a Span to an arbitrary value.

Enums§

ParseMode
The context a meta item parser is operating in.

Traits§

ContainerFrom
Converts a HasAttributes type to a stored container value.
ExtractAttributes
Extracts a structure out of a syn::Attribute list.
HasAttributes
Trait for a syn type containing a list of attributes.
ParseAttributes
Parses a structure out of a syn::Attribute list.
ParseMetaAppend
Parses a meta item for a structure with named fields that concatenates all matching items.
ParseMetaFlatNamed
Parses a meta item for a structure with named fields.
ParseMetaFlatUnnamed
Parses a meta item for a structure with unnamed fields.
ParseMetaItem
Base trait for parsing a single field out of syn::parse::ParseStream.
ParseMetaRest
Parses a meta item for a structure with named fields that consumes all fields.
ToKeyString
A trait for converting an attribute key to a string.

Type Aliases§

Error
The error type for parsers.
Result
The result of a parse method.