#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub enum HyperThreadingStatus
{
On,
Off,
ForceOff,
NotSupported,
NotImplemented,
}
impl FromBytes for HyperThreadingStatus
{
type Error = ParseHyperThreadingStatusError;
#[inline(always)]
fn from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>
{
use self::HyperThreadingStatus::*;
let value = match bytes
{
b"on" => On,
b"off" => Off,
b"forceoff" => ForceOff,
b"notsupported" => NotSupported,
b"notimplemented" => NotImplemented,
_ => return Err(ParseHyperThreadingStatusError::UnknownVariant(bytes.to_vec())),
};
Ok(value)
}
}