pub fn from_u8(n: u8) -> Result<TargetType> {
        match n {
            0 => Ok(TargetType::CenterOfGravity),
            1 => Ok(TargetType::Parabola),
            2 => Ok(TargetType::Gaussian),
            3 => Ok(TargetType::Peak),
            _ => Err(Error::InvalidTargetType(n)),
        }
    }
/// Returns the target type for this `u8`.
///
/// # Examples
///
/// ```
/// use sdc::point::TargetType;
/// assert_eq!(TargetType::Peak, TargetType::from_u8(3).unwrap());
/// assert!(TargetType::from_u8(10).is_err());
/// ```
Returns the target type for this `u8`.
Returns the target type for this ` u8 ` .
pub fn from_u8(n: u8) -> Result<TargetType> {
        match n {
            0 => Ok(TargetType::CenterOfGravity),
            1 => Ok(TargetType::Parabola),
            2 => Ok(TargetType::Gaussian),
            3 => Ok(TargetType::Peak),
            _ => Err(Error::InvalidTargetType(n)),
        }
    }
pub fn from_u8 ( n : u8 ) -> Result < TargetType > { match n { 0 => Ok ( TargetType :: CenterOfGravity ) , 1 => Ok ( TargetType :: Parabola ) , 2 => Ok ( TargetType :: Gaussian ) , 3 => Ok ( TargetType :: Peak ) , _ => Err ( Error :: InvalidTargetType ( n ) ) , } }
Returns the target type for this `u8`.
Returns the target type for this ` u8 ` .
n
u8
examples
None