Struct darling::error::Error
[−]
[src]
pub struct Error { /* fields omitted */ }An error encountered during attribute parsing.
Given that most errors darling encounters represent code bugs in dependent crates, the internal structure of the error is deliberately opaque.
Methods
impl Error[src]
pub fn custom<T>(msg: T) -> Error where
T: Display, [src]
T: Display,
Creates a new error with a custom message.
pub fn duplicate_field(name: &str) -> Error[src]
Creates a new error for a field that appears twice in the input.
pub fn missing_field(name: &str) -> Error[src]
Creates a new error for a non-optional field that does not appear in the input.
pub fn unknown_field(name: &str) -> Error[src]
Creates a new error for a field name that appears in the input but does not correspond to a known field.
pub fn unsupported_format(format: &str) -> Error[src]
pub fn unexpected_type(ty: &str) -> Error[src]
Creates a new error for a field which has an unexpected literal type.
pub fn unknown_value(value: &str) -> Error[src]
Creates a new error for a value which doesn't match a set of expected literals.
pub fn too_few_items(min: usize) -> Error[src]
Creates a new error for a list which did not get enough items to proceed.
pub fn too_many_items(max: usize) -> Error[src]
Creates a new error when a list got more items than it supports. The max argument
is the largest number of items the receiver could accept.
pub fn multiple(errors: Vec<Error>) -> Error[src]
Bundle a set of multiple errors into a single Error instance.
Panics
This function will panic if errors.is_empty() == true.
pub fn flatten(self) -> Error[src]
Recursively converts a tree of errors to a flattened list.
pub fn at<T>(self, location: T) -> Error where
T: Display, [src]
T: Display,
Adds a location to the error, such as a field or variant. Locations must be added in reverse order of specificity.
pub fn len(&self) -> usize[src]
Gets the number of individual errors in this error.
This function should never return 0, as it shouldn't be possible to construct
a multi-error from an empty Vec.
Trait Implementations
impl Debug for Error[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>[src]
Formats the value using the given formatter. Read more
impl IntoIterator for Error[src]
type Item = Error
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
ⓘImportant traits for IntoIterfn into_iter(self) -> IntoIter[src]
Creates an iterator from a value. Read more
impl Display for Error[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
Formats the value using the given formatter. Read more