ebml_iterable/
lib.rs

1//! This crate provides an iterator and a serializer for [EBML][EBML] files.  Its primary goal is to provide typed iteration and serialization as lightly and quickly as possible.
2//!
3//! [EBML][EBML] stands for Extensible Binary Meta-Language and is somewhat of a
4//! binary version of XML. It's used for container formats like [WebM][webm] or
5//! [MKV][mkv].
6//!
7//! # Important - Specifications
8//! 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][webm-iterable].
9//!
10//! 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]`](https://docs.rs/ebml-iterable-specification-derive/latest/ebml_iterable_specification_derive/attr.ebml_specification.html) macro.
11//!
12//! # Features
13//!
14//! There is currently only one optional feature in this crate, but that may change over time as needs arise.
15//!
16//! * **derive-spec** -
17//!     When enabled, this provides the [`#[ebml_specification]`](https://docs.rs/ebml-iterable-specification-derive/latest/ebml_iterable_specification_derive/attr.ebml_specification.html) attribute macro to simplify implementation of the [`EbmlSpecification`][`specs::EbmlSpecification`] and [`EbmlTag`][`specs::EbmlTag`] traits.  This introduces dependencies on [`syn`](https://crates.io/crates/syn), [`quote`](https://crates.io/crates/quote), and [`proc-macro2`](https://crates.io/crates/proc-macro2), so expect compile times to increase a little.
18//!
19//! [EBML]: http://ebml.sourceforge.net/
20//! [webm]: https://www.webmproject.org/
21//! [mkv]: http://www.matroska.org/technical/specs/index.html
22//! [rfc8794]: https://datatracker.ietf.org/doc/rfc8794/
23//! [webm-iterable]: https://crates.io/crates/webm_iterable
24//!
25
26mod errors;
27mod tag_iterator;
28mod tag_writer;
29pub mod tools;
30pub mod specs;
31mod tag_iterator_util;
32mod spec_util;
33
34#[cfg(feature = "futures")]
35pub mod nonblocking;
36
37pub use self::tag_iterator::TagIterator;
38pub use self::tag_writer::{TagWriter, WriteOptions};
39
40pub mod iterator {
41    pub use super::tag_iterator_util::AllowableErrors;
42}
43
44pub mod error {
45
46    //!
47    //! Potential errors that can occur when reading or writing EBML data.
48    //!
49    pub use super::errors::tag_iterator::TagIteratorError;
50    pub use super::errors::tag_iterator::CorruptedFileError;
51    pub use super::errors::tag_writer::TagWriterError;
52
53    ///
54    /// Error details that may be included in some thrown errors
55    ///
56    pub use super::errors::tool::ToolError;
57}