Skip to main content

Crate ebml_iterable

Crate ebml_iterable 

Source
Expand description

This crate provides an iterator and a serializer for EBML files. Its primary goal is to provide typed iteration and serialization as lightly and quickly as possible.

EBML stands for Extensible Binary Meta-Language and is somewhat of a binary version of XML. It’s used for container formats like WebM or MKV.

§Important - Specifications

The iterator contained in this crate is spec-agnostic and requires a specification implementing the specs::EbmlSpecification and specs::EbmlTag traits to read files. Typically, you would only use this crate to implement a custom specification - most often you would prefer a crate providing an existing specification, like webm-iterable.

Implementing custom specifications can be made less painful and safer by enabling the "derive-spec" feature flag in this crate and using the #[ebml_specification] macro.

§Features

There are currently two optional features in this crate.

  • derive-spec - When enabled, this provides the #[ebml_specification] attribute macro to simplify implementation of the EbmlSpecification and EbmlTag traits. This introduces dependencies on syn, quote, and proc-macro2, so expect compile times to increase a little.

  • futures - Enables the async/nonblocking iterator support in [nonblocking]. This exposes [TagIteratorAsync] and allows integration with [futures::AsyncRead] sources.

Modules§

error
Potential errors that can occur when reading or writing EBML data.
iterator
specs
Provides the EBML specification types.
tools
Contains a number of tools that are useful when working with EBML encoded files.

Structs§

PositionedTag
A decoded tag and its byte offset in the input stream.
TagDecoder
Incrementally decodes EBML data as bytes become available.
TagIterator
Provides an iterator over EBML files (read from a source implementing the std::io::Read trait). Can be configured to read specific “Master” tags as complete objects rather than just emitting when they start and end.
TagWriter
Provides a tool to write EBML files based on Tags. Writes to a destination that implements std::io::Write.
WriteOptions
Options that can be passed to the writer to customize written output