Skip to main content

playout_runtime/
error.rs

1//! Crate error type.
2
3/// Errors produced by schedule construction, transition planning, and
4/// SCTE-35 emission-point construction.
5#[derive(Debug, thiserror::Error)]
6#[non_exhaustive]
7pub enum Error {
8    /// [`crate::schedule::Schedule::push`] was called with an entry whose
9    /// `planned_start` does not strictly follow the schedule's last entry —
10    /// entries must be supplied in increasing timeline order.
11    #[error(
12        "schedule entries must be strictly increasing by planned_start: \
13         previous entry starts at {prev}, new entry starts at {next}"
14    )]
15    OutOfOrder {
16        /// `planned_start` of the schedule's current last entry.
17        prev: u64,
18        /// `planned_start` of the entry that was rejected.
19        next: u64,
20    },
21    /// Splice-point conditioning ([`ssai_runtime::splice::condition_splice_point_wrapping`],
22    /// via [`crate::scte35::build_splice_insert`]) found no candidate
23    /// boundary within the caller's tolerance, or was given no candidates at
24    /// all.
25    #[error(transparent)]
26    SpliceConditioning(#[from] ssai_runtime::Error),
27}
28
29/// Crate result alias.
30pub type Result<T> = core::result::Result<T, Error>;