binex 0.5.2

BINEX encoder and decoder for real-time GNSS
Documentation
//! Monument / Geodetic marker source description

/// [MonumentGeoMetadata] describes the source of information
/// of the Monument marker record
#[derive(Debug, Clone, Copy, Default, PartialEq)]
pub enum MonumentGeoMetadata {
    /// Monument marker was generated by the firmware
    /// of a GNSS receiver
    ReceiverFirmware = 0,
    #[default]
    /// Monument marker was generated by RINEX to BINEX conversion
    RNX2BIN = 1,
    /// Created from IGS data (by software)
    IGS = 2,
    /// Information supplied by external user (like configuration file)
    External = 3,
    /// Created from other formats or streams (not RINEX nor BINEX)
    Other = 4,
}

impl From<u8> for MonumentGeoMetadata {
    fn from(val: u8) -> Self {
        match val {
            0 => Self::ReceiverFirmware,
            1 => Self::RNX2BIN,
            2 => Self::IGS,
            3 => Self::External,
            _ => Self::Other,
        }
    }
}

impl From<MonumentGeoMetadata> for u8 {
    fn from(val: MonumentGeoMetadata) -> Self {
        match val {
            MonumentGeoMetadata::ReceiverFirmware => 0,
            MonumentGeoMetadata::RNX2BIN => 1,
            MonumentGeoMetadata::IGS => 2,
            MonumentGeoMetadata::External => 3,
            MonumentGeoMetadata::Other => 4,
        }
    }
}