pub struct ErrorReader<R> { /* private fields */ }
Expand description
Implements a XmlReader
that is able to provide additional error
information like the current cursor position or the chain of currently
processed XML tags.
Implementations§
Source§impl<R> ErrorReader<R>where
R: XmlReader,
impl<R> ErrorReader<R>where
R: XmlReader,
Sourcepub fn new(inner: R) -> Self
pub fn new(inner: R) -> Self
Create a new ErrorReader
instance from the passed reader.
Sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Extracts the internal reader from the instance.
Trait Implementations§
Source§impl<R: Debug> Debug for ErrorReader<R>
impl<R: Debug> Debug for ErrorReader<R>
Source§impl<R> XmlReader for ErrorReader<R>where
R: XmlReader,
impl<R> XmlReader for ErrorReader<R>where
R: XmlReader,
Source§fn resolve<'n>(
&self,
name: QName<'n>,
attribute: bool,
) -> (ResolveResult<'_>, LocalName<'n>)
fn resolve<'n>( &self, name: QName<'n>, attribute: bool, ) -> (ResolveResult<'_>, LocalName<'n>)
Resolves a qname in the current context of the XML file.
Source§fn prefixes(&self) -> PrefixIter<'_>
fn prefixes(&self) -> PrefixIter<'_>
Returns an iterator the walks over all known namespace prefixes for the
current context of the XML file.
Source§fn current_position(&self) -> u64
fn current_position(&self) -> u64
Returns the current position (byte offset) in the current XML file.
Source§fn error_position(&self) -> u64
fn error_position(&self) -> u64
Returns the position (byte offset) of the last detected error.
Source§fn extend_error(&self, error: Error) -> Error
fn extend_error(&self, error: Error) -> Error
Add the error position to the passed error and return it.
Source§fn map_error<E>(&self, error: E) -> Error
fn map_error<E>(&self, error: E) -> Error
Converts the passed
error
to an Error
, adds the error information
using extend_error
and returns it.Source§fn map_result<T, E>(&self, result: Result<T, E>) -> Result<T, Error>
fn map_result<T, E>(&self, result: Result<T, E>) -> Result<T, Error>
Same as
map_error
, but for the passed result
.Source§fn err<E>(&self, error: E) -> Result<(), Error>
fn err<E>(&self, error: E) -> Result<(), Error>
Create a result from the passed
error
using map_error
and returns it.Source§fn read_attrib<T>(
&self,
store: &mut Option<T>,
name: &'static [u8],
value: &[u8],
) -> Result<(), Error>where
T: DeserializeBytes,
fn read_attrib<T>(
&self,
store: &mut Option<T>,
name: &'static [u8],
value: &[u8],
) -> Result<(), Error>where
T: DeserializeBytes,
Helper function to convert and store an attribute from the XML event. Read more
Source§fn with_error_info(self) -> ErrorReader<Self>
fn with_error_info(self) -> ErrorReader<Self>
Wraps the current reader in a new
ErrorReader
.Source§impl<'a, R> XmlReaderSync<'a> for ErrorReader<R>where
R: XmlReaderSync<'a>,
impl<'a, R> XmlReaderSync<'a> for ErrorReader<R>where
R: XmlReaderSync<'a>,
Auto Trait Implementations§
impl<R> Freeze for ErrorReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for ErrorReader<R>where
R: RefUnwindSafe,
impl<R> Send for ErrorReader<R>where
R: Send,
impl<R> Sync for ErrorReader<R>where
R: Sync,
impl<R> Unpin for ErrorReader<R>where
R: Unpin,
impl<R> UnwindSafe for ErrorReader<R>where
R: UnwindSafe,
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