Error

Type Alias Error 

Source
pub type Error = DeserializeError<XmlError>;
Expand description

Error type for Atom parsing

Aliased Type§

pub enum Error {
    Parser(XmlError),
    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,
    },
}

Variants§

§

Parser(XmlError)

Error emitted by the format-specific parser.

§

Reflect

Reflection error from Partial operations.

Fields

§error: ReflectError

The underlying reflection error.

§span: Option<Span>

Source span where the error occurred (if available).

§path: Option<Path>

Path through the type structure where the error occurred.

§

TypeMismatch

Type mismatch during deserialization.

Fields

§expected: &'static str

The expected type or token.

§got: String

The actual type or token that was encountered.

§span: Option<Span>

Source span where the mismatch occurred (if available).

§path: Option<Path>

Path through the type structure where the error occurred.

§

Unsupported(String)

Unsupported type or operation.

§

UnknownField

Unknown field encountered when deny_unknown_fields is set.

Fields

§field: String

The unknown field name.

§span: Option<Span>

Source span where the unknown field was found (if available).

§path: Option<Path>

Path through the type structure where the error occurred.

§

CannotBorrow

Cannot borrow string from input (e.g., escaped string into &str).

Fields

§message: String

Description of why borrowing failed.

§

MissingField

Required field missing from input.

Fields

§field: &'static str

The field that is missing.

§type_name: &'static str

The type that contains the field.

§span: Option<Span>

Source span where the struct was being parsed (if available).

§path: Option<Path>

Path through the type structure where the error occurred.

§

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 Shape

The shape that was expected (provides access to type info and attributes).

§got_container: ContainerKind

The container kind that was received (Object, Array, Element).

§span: Option<Span>

Source span where the mismatch occurred (if available).

§path: Option<Path>

Path through the type structure where the error occurred.

§

UnexpectedEof

Unexpected end of input.

Fields

§expected: &'static str

What was expected before EOF.