pub struct SliceReader<'a> { /* private fields */ }
Expand description
Implements a XmlReader
for string slices.
Implementations§
Source§impl<'a> SliceReader<'a>
impl<'a> SliceReader<'a>
Sourcepub fn new(s: &'a str) -> Self
pub fn new(s: &'a str) -> Self
Creates a new SliceReader
instance from the passed string slice s
.
Trait Implementations§
Source§impl Debug for SliceReader<'_>
impl Debug for SliceReader<'_>
Source§impl XmlReader for SliceReader<'_>
impl XmlReader for SliceReader<'_>
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
.Auto Trait Implementations§
impl<'a> Freeze for SliceReader<'a>
impl<'a> RefUnwindSafe for SliceReader<'a>
impl<'a> Send for SliceReader<'a>
impl<'a> Sync for SliceReader<'a>
impl<'a> Unpin for SliceReader<'a>
impl<'a> UnwindSafe for SliceReader<'a>
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