pub enum DeserializeError<E> {
Parser(E),
Reflect {
error: ReflectError,
span: Option<Span>,
path: Option<Path>,
},
TypeMismatch {
expected: &'static str,
got: String,
span: Option<Span>,
path: Option<Path>,
},
Unsupported(String),
UnknownField {
field: String,
span: Option<Span>,
path: Option<Path>,
},
CannotBorrow {
message: String,
},
MissingField {
field: &'static str,
type_name: &'static str,
span: Option<Span>,
path: Option<Path>,
},
ExpectedScalarGotStruct {
expected_shape: &'static Shape,
got_container: ContainerKind,
span: Option<Span>,
path: Option<Path>,
},
UnexpectedEof {
expected: &'static str,
},
}Expand description
Error produced by FormatDeserializer.
Variants§
Parser(E)
Error emitted by the format-specific parser.
Reflect
Reflection error from Partial operations.
Fields
error: ReflectErrorThe underlying reflection error.
TypeMismatch
Type mismatch during deserialization.
Fields
Unsupported(String)
Unsupported type or operation.
UnknownField
Unknown field encountered when deny_unknown_fields is set.
Fields
CannotBorrow
Cannot borrow string from input (e.g., escaped string into &str).
MissingField
Required field missing from input.
Fields
ExpectedScalarGotStruct
Expected a scalar value but got a struct/object.
This typically happens when a format-specific mapping expects a scalar
(like a KDL property name=value) but receives a child node instead
(like KDL node with arguments name "value").
Fields
expected_shape: &'static ShapeThe shape that was expected (provides access to type info and attributes).
got_container: ContainerKindThe container kind that was received (Object, Array, Element).
UnexpectedEof
Unexpected end of input.
Implementations§
Source§impl<E> DeserializeError<E>
impl<E> DeserializeError<E>
Sourcepub fn reflect(error: ReflectError) -> DeserializeError<E>
pub fn reflect(error: ReflectError) -> DeserializeError<E>
Create a Reflect error without span or path information.
Sourcepub fn reflect_with_span(error: ReflectError, span: Span) -> DeserializeError<E>
pub fn reflect_with_span(error: ReflectError, span: Span) -> DeserializeError<E>
Create a Reflect error with span information.
Sourcepub fn reflect_with_context(
error: ReflectError,
span: Option<Span>,
path: Path,
) -> DeserializeError<E>
pub fn reflect_with_context( error: ReflectError, span: Option<Span>, path: Path, ) -> DeserializeError<E>
Create a Reflect error with span and path information.
Sourcepub fn with_path(self, new_path: Path) -> DeserializeError<E>
pub fn with_path(self, new_path: Path) -> DeserializeError<E>
Add path information to an error (consumes and returns the modified error).