Struct rxml::Parser

source · []
pub struct Parser { /* private fields */ }
Expand description

Low-level XML Parser

The Parser converts crate::lexer::Tokens into Events.

It is a low-level interface which expects to be driven from a TokenRead source.

Implementations

Create a new parser

Parse a single event using tokens from r.

If the end of file has been reached after a well-formed document, None is returned. Otherwise, if the document is still will-formed, the next Event is returned.

If the document violates a well-formedness constraint, the XML 1.0 grammar or namespacing rules, the corresponding error is returned.

Errors from the token source (such as I/O errors) are forwarded.

Note: Exchanging the token source between calls to Parser::parse() is possible, but not advisible.

Release all temporary buffers

This is sensible to call when it is expected that no more data will be processed by the parser for a while and the memory is better used elsewhere.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.