pub struct XdvParser<T: XdvEvents> { /* private fields */ }
Expand description

State for parsing an XDV file.

Implementations

Create a new XDV/SPX parser.

Methods implemented by events will be called as various items are encountered in the file.

Parse an entire XDV/SPX stream.

Returns the input “events” variable and the number of bytes that were processed.

Because the io::Read trait is used, the event result type must implement From<io::Error> as well as From<XdvError>.

Parse a XDV/SPX stream looking at the postamble first.

Unlike Self::process, this method relies on the input being seekable, and starts by processing the expected “postamble” structure of the file which provides summary information about the stream contents.

Returns the input “events” variable.

Because traits from std::io are used, the event result type must implement From<std::io::Error> as well as From<XdvError>.

Parse the next chunk of XDV data.

Returns the number of bytes consumed from the input buffer, and whether the driver should continue. If the number of bytes is not the same as the buffer size, some of the existing bytes must be re-fed to the parser. If the returned value is 0, you need a bigger buffer in order to be able to parse the next directive.

Get the current byte offset of the parsing.

Finish parsing, consume this object, and return the underlying event handler, assuming all went well.

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.