pub struct XmlError {
pub span: Range<usize>,
pub error: XmlErrorInner,
}Expand description
Error returned from loading an XML document.
Fields§
§span: Range<usize>Where in the document the node that caused the issue is found.
error: XmlErrorInnerThe inner error variant.
Implementations§
Source§impl XmlError
impl XmlError
Sourcepub fn missing_field(node: &Node<'_, '_>, name: &str) -> Self
pub fn missing_field(node: &Node<'_, '_>, name: &str) -> Self
Create an error for a node with a missing field with name name.
Sourcepub fn missing_attribute(node: &Node<'_, '_>, name: &str) -> Self
pub fn missing_attribute(node: &Node<'_, '_>, name: &str) -> Self
Create an error for a node with a missing attribute with name name.
Sourcepub fn other(node: &Node<'_, '_>, info: &str) -> Self
pub fn other(node: &Node<'_, '_>, info: &str) -> Self
Create an error for some other, general error.
Sourcepub fn parse_int(node: &Node<'_, '_>, attr: &str, err: ParseIntError) -> Self
pub fn parse_int(node: &Node<'_, '_>, attr: &str, err: ParseIntError) -> Self
Create an error for failing to parse a string as an integer.
Sourcepub fn parse_float(
node: &Node<'_, '_>,
attr: &str,
err: ParseFloatError,
) -> Self
pub fn parse_float( node: &Node<'_, '_>, attr: &str, err: ParseFloatError, ) -> Self
Create an error for failing to parse a string as a float.
Sourcepub fn parse_bool(node: &Node<'_, '_>, attr: &str, err: ParseBoolError) -> Self
pub fn parse_bool(node: &Node<'_, '_>, attr: &str, err: ParseBoolError) -> Self
Create an error for failing to parse a string as a boolean.
Sourcepub fn parse_date_time(node: &Node<'_, '_>, attr: &str, err: ParseError) -> Self
pub fn parse_date_time(node: &Node<'_, '_>, attr: &str, err: ParseError) -> Self
Create an error for failing to parse a string as a date time.
Sourcepub fn parse_uuid(node: &Node<'_, '_>, attr: &str, err: Error) -> Self
pub fn parse_uuid(node: &Node<'_, '_>, attr: &str, err: Error) -> Self
Create an error for failing to parse a string as a UUID.
Sourcepub fn missing_content(node: &Node<'_, '_>) -> Self
pub fn missing_content(node: &Node<'_, '_>) -> Self
Create an error indicating that node does not have the necessary content.
Trait Implementations§
Source§impl Error for XmlError
impl Error for XmlError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for XmlError
impl RefUnwindSafe for XmlError
impl Send for XmlError
impl Sync for XmlError
impl Unpin for XmlError
impl UnwindSafe for XmlError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more