/// Returns a CyclePeriod for a given Metriful register value.
Returns a CyclePeriod for a given Metriful register value.
Returns a CyclePeriod for a given Metriful register value .
pub fn from_value(value: u8) -> Result<CyclePeriod> {
    match value {
      0 => Ok(CyclePeriod::Period0),
      1 => Ok(CyclePeriod::Period1),
      2 => Ok(CyclePeriod::Period2),
      _ => Err(MetrifulError::InvalidCyclePeriod(value))
    }
  }
pub fn from_value ( value : u8 ) -> Result < CyclePeriod > { match value { 0 => Ok ( CyclePeriod :: Period0 ) , 1 => Ok ( CyclePeriod :: Period1 ) , 2 => Ok ( CyclePeriod :: Period2 ) , _ => Err ( MetrifulError :: InvalidCyclePeriod ( value ) ) } }
Returns a CyclePeriod for a given Metriful register value.
Returns a CyclePeriod for a given Metriful register value .
value
u8