use thiserror::Error;
pub mod availability;
pub mod clock;
pub use broadcast_common::http_date;
pub mod live_edge;
pub mod period;
pub mod utc_timing;
pub use broadcast_dash::xs_datetime as datetime;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
#[non_exhaustive]
pub enum TimingError {
#[error("response timestamp precedes the request timestamp")]
ExchangeReversed,
#[error("round trip of {rtt_us} us exceeds the {max_us} us limit")]
RttTooLarge {
rtt_us: u64,
max_us: u64,
},
#[error("UTC response body exceeds {max} bytes")]
BodyTooLarge {
max: usize,
},
#[error("UTC response body is not UTF-8")]
NotUtf8,
#[error("UTCTiming scheme {0} is not sampled from a response body")]
SchemeNotSampled(utc_timing::UtcScheme),
#[error(transparent)]
DateTime(#[from] datetime::DateTimeError),
#[error(transparent)]
HttpDate(#[from] http_date::HttpDateError),
}