moq_room/lib.rs
1//! Headless multi-participant rooms over MoQ.
2//!
3//! A room is a path prefix. There is no service and no storage: joining is
4//! minting a moq-token rooted at that prefix (the LiveKit AccessToken analogue)
5//! and dialing the relay.
6//!
7//! Participants are discovered from the announce stream. Identity is the path
8//! before `camera` / `screen`. Each participant publishes:
9//!
10//! - `{identity}/camera.hang`: camera + microphone
11//! - `{identity}/screen.hang`: screenshare; its announce/unannounce is the share lifecycle
12//!
13//! This is the native counterpart of [`@moq/room`](https://www.npmjs.com/package/@moq/room),
14//! extracted from hang.live's roster and iroh-live's announce-bus redesign of
15//! `iroh-rooms`. Gossip discovery, tickets, and 1:1 Call stay in iroh-live.
16//! Capture and encode stay in `moq-video` / `moq-audio`.
17
18#![warn(missing_docs)]
19
20pub mod chat;
21mod claims;
22mod path;
23mod room;
24
25pub use claims::claims;
26pub use path::{Kind, Parsed, broadcast_path, kind_from_segment, parse};
27pub use room::{Event, Room};
28
29/// Errors constructing or consuming a room participant.
30#[derive(Debug, thiserror::Error)]
31#[non_exhaustive]
32pub enum Error {
33 /// A room track could not be opened or read.
34 #[error(transparent)]
35 Net(#[from] moq_net::Error),
36 /// A chat record could not be encoded or decoded.
37 #[error(transparent)]
38 Json(#[from] moq_json::Error),
39 /// A participant identity must contain a nonempty path.
40 #[error("participant identity must not be empty")]
41 EmptyIdentity,
42}