moq_archive/lib.rs
1//! Versioned hang recording objects on any [`object_store::ObjectStore`].
2//!
3//! The crate owns the portable layout and codecs: percent-encoded track names, `.info` JSON,
4//! the binary segment envelope, and put/get/list/delete. Callers that need runtime dispatch
5//! supply `Arc<dyn ObjectStore>`; the archive API itself stays generic.
6//!
7//! Group bounds are finite inclusive ranges in first-to-last order:
8//! ```
9//! let key = moq_archive::Key::groups("video", 5..=7)?;
10//! assert_eq!(key.track(), "video");
11//! # Ok::<(), moq_archive::Error>(())
12//! ```
13
14pub use object_store;
15
16mod error;
17pub mod info;
18mod path;
19pub mod segment;
20pub mod store;
21
22pub use error::{Error, Result};
23pub use info::Info;
24pub use path::Key;
25pub use segment::{Frame, Group, Object};
26pub use store::Store;
27
28/// Recording format version written into `.info` and the binary envelope.
29pub const VERSION: u64 = 1;
30
31/// Largest group, segment, or timestamp value the format allows (`2^53 - 1`).
32pub const ID_MAX: u64 = (1 << 53) - 1;
33
34/// Decimal width of group and segment ID filename fields.
35pub(crate) const ID_WIDTH: usize = 19;