Enum rxml::error::XmlError

source ·
pub enum XmlError {
Show 16 variants InvalidEof(&'static str), UndeclaredEntity, InvalidChar(&'static str, u32, bool), UnexpectedChar(&'static str, char, Option<&'static [&'static str]>), UnexpectedByte(&'static str, u8, Option<&'static [&'static str]>), InvalidSyntax(&'static str), UnexpectedToken(&'static str, &'static str, Option<&'static [&'static str]>), DuplicateAttribute, ElementMismatch, MultiColonName(&'static str), EmptyNamePart(&'static str), UndeclaredNamespacePrefix(&'static str), ReservedNamespacePrefix, ReservedNamespaceName, InvalidLocalName(&'static str), EmptyNamespaceUri,
}
Expand description

Violation of a well-formedness or namespace-well-formedness constraint or the XML 1.0 grammar.

Variants§

§

InvalidEof(&'static str)

End-of-file encountered during a construct where more data was expected.

The contents are implementation details.

§

UndeclaredEntity

Attempt to refer to an undeclared entity.

Note: May also be emitted in some cases of malformed entities as the lexer is very conservative about how many chars are read to interpret an entity.

§

InvalidChar(&'static str, u32, bool)

Unicode codepoint which is not allowed in XML 1.0 encountered.

The contents are implementation details.

§

UnexpectedChar(&'static str, char, Option<&'static [&'static str]>)

Unicode codepoint which was not expected at that point in the grammar.

The contents are implementation details.

§

UnexpectedByte(&'static str, u8, Option<&'static [&'static str]>)

Byte which was not expected at that point in the grammar.

The contents are implementation details.

§

InvalidSyntax(&'static str)

Generalized invalid syntactic construct which does not fit into any of the other categories.

The contents are implementation details.

§

UnexpectedToken(&'static str, &'static str, Option<&'static [&'static str]>)

Token was not expected by the parser at that point in the grammar.

The contents are implementation details.

§

DuplicateAttribute

Attribute was declared multiple times in the same element.

Note: This will also be emitted for namespaced attributes which resolve to the same (uri, localname) pair after prefix resolution.

§

ElementMismatch

Ending tag name does not match opening tag.

§

MultiColonName(&'static str)

More than one colon encountered in a name.

The contents are implementation details.

§

EmptyNamePart(&'static str)

One side of the colon in a name was empty.

The contents are implementation details.

§

UndeclaredNamespacePrefix(&'static str)

Use of an undeclared namespace prefix.

The contents are implementation details.

§

ReservedNamespacePrefix

Attempt to redefine a reserved namespace prefix.

§

ReservedNamespaceName

Attempt to bind a reserved namespace name to the wrong prefix.

§

InvalidLocalName(&'static str)

Local name does not conform to Name production (invalid start char)

§

EmptyNamespaceUri

 Declared namespace URI is empty

Trait Implementations§

source§

impl Clone for XmlError

source§

fn clone(&self) -> XmlError

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 XmlError

source§

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

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

impl Display for XmlError

source§

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

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

impl Error for XmlError

1.30.0 · source§

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

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<Error> for XmlError

source§

fn from(other: ValidationError) -> Self

Converts to this type from the input type.
source§

impl From<XmlError> for Error

source§

fn from(e: XmlError) -> Self

Converts to this type from the input type.
source§

impl PartialEq for XmlError

source§

fn eq(&self, other: &XmlError) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for XmlError

source§

impl StructuralPartialEq for XmlError

Auto Trait Implementations§

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> 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> ToCompactString for T
where T: Display,

source§

fn to_compact_string(&self) -> CompactString

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

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

§

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>,

§

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>,

§

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.