pub struct Error { /* private fields */ }
Expand description
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.
Implementations§
source§impl Error
impl Error
sourcepub fn duplicate_field(name: &str) -> Error
pub fn duplicate_field(name: &str) -> Error
Creates a new error for a field that appears twice in the input.
sourcepub fn missing_field(name: &str) -> Error
pub fn missing_field(name: &str) -> Error
Creates a new error for a non-optional field that does not appear in the input.
sourcepub fn unknown_field(name: &str) -> Error
pub fn unknown_field(name: &str) -> Error
Creates a new error for a field name that appears in the input but does not correspond to a known field.
sourcepub fn unsupported_shape(shape: &str) -> Error
pub fn unsupported_shape(shape: &str) -> Error
Creates a new error for a struct or variant that does not adhere to the supported shape.
pub fn unsupported_format(format: &str) -> Error
sourcepub fn unexpected_type(ty: &str) -> Error
pub fn unexpected_type(ty: &str) -> Error
Creates a new error for a field which has an unexpected literal type.
sourcepub fn unknown_value(value: &str) -> Error
pub fn unknown_value(value: &str) -> Error
Creates a new error for a value which doesn’t match a set of expected literals.
sourcepub fn too_few_items(min: usize) -> Error
pub fn too_few_items(min: usize) -> Error
Creates a new error for a list which did not get enough items to proceed.
sourcepub fn too_many_items(max: usize) -> Error
pub fn too_many_items(max: usize) -> Error
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.
sourcepub fn multiple(errors: Vec<Error, Global>) -> Error
pub fn multiple(errors: Vec<Error, Global>) -> Error
Bundle a set of multiple errors into a single Error
instance.
Panics
This function will panic if errors.is_empty() == true
.