use alloc::string::String;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error(
"no candidate splice boundary within {tolerance_ticks} ticks of requested pts \
{requested_pts} (nearest delta {nearest_delta_ticks} ticks)"
)]
NoAlignedBoundary {
requested_pts: u64,
tolerance_ticks: u64,
nearest_delta_ticks: u64,
},
#[error("no candidate splice boundaries supplied")]
NoCandidates,
#[error("pts {pts} is not below the clock modulus {modulus} (or the modulus is zero)")]
PtsOutOfRange {
pts: u64,
modulus: u64,
},
#[error("base playlist has no EXT-X-PROGRAM-DATE-TIME; an EXT-X-DATERANGE requires one")]
MissingProgramDateTime,
#[error("interstitial asset source must be exactly one of X-ASSET-URI or X-ASSET-LIST")]
InvalidAssetSource,
#[error("session {0:?} has no active ad break")]
NoActiveBreak(String),
#[error("session {0:?} already has an active ad break")]
BreakAlreadyActive(String),
#[error("interstitial DATERANGE parse: {0}")]
TagParse(String),
#[error(transparent)]
HlsAttrValue(#[from] broadcast_hls::Error),
#[error("{what} must be a finite, non-negative number of seconds, got {value}")]
InvalidDuration {
what: &'static str,
value: f64,
},
}
pub type Result<T> = core::result::Result<T, Error>;