pub struct XMLStreamReader<'a, Resolver: EntityResolver = DefaultSAXHandler, Reporter: ErrorHandler = DefaultSAXHandler> { /* private fields */ }Implementations§
Source§impl<'a, Resolver: EntityResolver> XMLStreamReader<'a, Resolver>
impl<'a, Resolver: EntityResolver> XMLStreamReader<'a, Resolver>
Sourcepub fn last_error(&self) -> Option<&SAXParseError>
pub fn last_error(&self) -> Option<&SAXParseError>
Returns the most recently occurred warning, error, or fatal error.
If none occurred, returns None.
When no user-defined error handler is configured, this method can be used to catch errors
other than unrecoverable errors.
To catch all errors that occur during the parsing process, a user-defined error handler
must be configured.
Source§impl<'a, Resolver: EntityResolver, Reporter: ErrorHandler> XMLStreamReader<'a, Resolver, Reporter>
impl<'a, Resolver: EntityResolver, Reporter: ErrorHandler> XMLStreamReader<'a, Resolver, Reporter>
pub fn parse_uri( &mut self, uri: impl AsRef<URIStr>, encoding: Option<&str>, ) -> Result<(), XMLError>
pub fn parse_reader( &mut self, source: impl Read + 'a, encoding: Option<&str>, uri: Option<&URIStr>, ) -> Result<(), XMLError>
pub fn parse_str( &mut self, s: &str, uri: Option<&URIStr>, ) -> Result<(), XMLError>
pub fn reset(&mut self) -> Result<(), XMLError>
pub fn next_event<'b>(&'b mut self) -> Result<XMLEvent<'b>, XMLError>
pub fn next_tag<'b>(&'b mut self) -> Result<XMLEvent<'b>, XMLError>
pub fn namespaces(&self) -> &NamespaceStack
Sourcepub fn locator(&self) -> Option<Arc<Locator>>
pub fn locator(&self) -> Option<Arc<Locator>>
Returns a valid locator if exists.
The returned locator is valid from after the StartDocument event until
before parsing ends due to the EndDocument event or a fatal error.
Outside the locator’s valid range, it returns None.
Sourcepub fn error_handler(&self) -> Option<&Reporter>
pub fn error_handler(&self) -> Option<&Reporter>
If a user-defined error handler is configured, it will be returned.
Sourcepub fn set_error_handler(&mut self, handler: Reporter) -> Option<Reporter>
pub fn set_error_handler(&mut self, handler: Reporter) -> Option<Reporter>
Configure a user-defined error handler. If a handler is already configured, return it.
Sourcepub fn take_error_handler(&mut self) -> Option<Reporter>
pub fn take_error_handler(&mut self) -> Option<Reporter>
If a user-defined error handler is configured, it will be returned.
The error handler will be unset.