Enum quick_xml::errors::Error

source ·
pub enum Error {
    Io(Arc<Error>),
    Syntax(SyntaxError),
    IllFormed(IllFormedError),
    NonDecodable(Option<Utf8Error>),
    InvalidAttr(AttrError),
    EscapeError(EscapeError),
    UnknownPrefix(Vec<u8>),
    InvalidPrefixBind {
        prefix: Vec<u8>,
        namespace: Vec<u8>,
    },
}
Expand description

The error type used by this crate.

Variants§

§

Io(Arc<Error>)

XML document cannot be read from or written to underlying source.

Contains the reference-counted I/O error to make the error type Cloneable.

§

Syntax(SyntaxError)

The document does not corresponds to the XML grammar.

§

IllFormed(IllFormedError)

The document is not well-formed.

§

NonDecodable(Option<Utf8Error>)

Input decoding error. If encoding feature is disabled, contains None, otherwise contains the UTF-8 decoding error

§

InvalidAttr(AttrError)

Attribute parsing error

§

EscapeError(EscapeError)

Escape error

§

UnknownPrefix(Vec<u8>)

Specified namespace prefix is unknown, cannot resolve namespace for it

§

InvalidPrefixBind

Error for when a reserved namespace is set incorrectly.

This error returned in following cases:

  • the XML document attempts to bind xml prefix to something other than http://www.w3.org/XML/1998/namespace
  • the XML document attempts to bind xmlns prefix
  • the XML document attempts to bind some prefix (except xml) to http://www.w3.org/XML/1998/namespace
  • the XML document attempts to bind some prefix to http://www.w3.org/2000/xmlns/

Fields

§prefix: Vec<u8>

The prefix that is tried to be bound

§namespace: Vec<u8>

Namespace to which prefix tried to be bound

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
source§

impl From<AttrError> for Error

source§

fn from(error: AttrError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for DeError

Available on crate feature serialize only.
source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: IoError) -> Error

Creates a new Error::Io from the given error

source§

impl From<EscapeError> for Error

source§

fn from(error: EscapeError) -> Error

Creates a new Error::EscapeError from the given error

source§

impl From<FromUtf8Error> for Error

source§

fn from(error: FromUtf8Error) -> Error

Creates a new Error::Utf8 from the given error

source§

impl From<IllFormedError> for Error

source§

fn from(error: IllFormedError) -> Self

Creates a new Error::IllFormed from the given error

source§

impl From<SyntaxError> for Error

source§

fn from(error: SyntaxError) -> Self

Creates a new Error::Syntax from the given error

source§

impl From<Utf8Error> for Error

source§

fn from(error: Utf8Error) -> Error

Creates a new Error::NonDecodable from the given error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.