use core::fmt;
pub type Result<T> = core::result::Result<T, Error>;
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum Error {
Parse(String),
UnknownSatellite(crate::GnssSatelliteId),
EpochOutOfRange,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::Parse(msg) => write!(f, "parse error: {msg}"),
Error::UnknownSatellite(id) => write!(f, "unknown satellite: {id}"),
Error::EpochOutOfRange => write!(f, "epoch out of range"),
}
}
}
impl std::error::Error for Error {}