pub struct IoReader<R> { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl<R> XmlReader for IoReader<R>
impl<R> XmlReader for IoReader<R>
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 namespaces(&self) -> NamespacesShared<'static>
fn namespaces(&self) -> NamespacesShared<'static>
Returns a map that contains all namespaces in the current context.
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 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<R> !Freeze for IoReader<R>
impl<R> !RefUnwindSafe for IoReader<R>
impl<R> Send for IoReader<R>where
R: Send,
impl<R> !Sync for IoReader<R>
impl<R> Unpin for IoReader<R>where
R: Unpin,
impl<R> UnwindSafe for IoReader<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
Source§impl<X> DeserializeReader for Xwhere
X: XmlReader,
impl<X> DeserializeReader for Xwhere
X: XmlReader,
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 raise_unexpected_attrib_checked(
&self,
attrib: Attribute<'_>,
) -> Result<(), Error>
fn raise_unexpected_attrib_checked( &self, attrib: Attribute<'_>, ) -> Result<(), Error>
Raises an
UnexpectedAttribute
error
for the given attribute if it is not globally allowed (e.g., an XSI attribute). Read moreSource§fn is_globally_allowed_attrib(&self, attrib: &Attribute<'_>) -> bool
fn is_globally_allowed_attrib(&self, attrib: &Attribute<'_>) -> bool
Returns
true
if the given attribute is a globally allowed XML Schema
Instance (XSI) attribute, false
otherwise. Read moreSource§fn resolve_local_name<'a>(&self, name: QName<'a>, ns: &[u8]) -> Option<&'a [u8]>
fn resolve_local_name<'a>(&self, name: QName<'a>, ns: &[u8]) -> Option<&'a [u8]>
Try to resolve the local name of the passed qname and the expected namespace. Read more
Source§fn init_start_tag_deserializer<'a, T>(
&self,
event: Event<'a>,
ns: Option<&[u8]>,
name: &[u8],
allow_any: bool,
) -> DeserializerResult<'a, T>where
T: WithDeserializer,
fn init_start_tag_deserializer<'a, T>(
&self,
event: Event<'a>,
ns: Option<&[u8]>,
name: &[u8],
allow_any: bool,
) -> DeserializerResult<'a, T>where
T: WithDeserializer,
Try to initialize a deserializer for the given
event
if it is a start
or empty tag that matches the passed ns
and name
. Read moreSource§fn get_dynamic_type_name<'a>(
&self,
event: &'a Event<'_>,
) -> Result<Option<Cow<'a, [u8]>>, Error>
fn get_dynamic_type_name<'a>( &self, event: &'a Event<'_>, ) -> Result<Option<Cow<'a, [u8]>>, Error>
Try to extract the type name of a dynamic type from the passed event. Read more
Source§fn init_deserializer_from_start_event<'a, T, F>(
&self,
event: Event<'a>,
f: F,
) -> Result<DeserializerOutput<'a, T>, Error>where
T: WithDeserializer,
F: FnOnce(&Self, &BytesStart<'a>) -> Result<<T as WithDeserializer>::Deserializer, Error>,
fn init_deserializer_from_start_event<'a, T, F>(
&self,
event: Event<'a>,
f: F,
) -> Result<DeserializerOutput<'a, T>, Error>where
T: WithDeserializer,
F: FnOnce(&Self, &BytesStart<'a>) -> Result<<T as WithDeserializer>::Deserializer, Error>,
Initializes a deserializer from the passed
event
. Read more