sinf 0.1.0

Library for obtaining in-depth system information at both the hardware and software levels
Documentation
#[allow(unused_imports)]
use serde::{Serialize, Serializer, ser::SerializeStruct, ser::SerializeTupleVariant};

impl Serialize for crate::Error {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: Serializer,
    {
        match self {
            Self::Unsupported => serializer.serialize_unit_variant("Error", 0, "Unsupported"),
            Self::Io(io) => {
                let mut state = serializer.serialize_tuple_variant("Error", 1, "Io", 1)?;
                state.serialize_field(&io.to_string())?;
                state.end()
            }
            Self::Other(other) => {
                let mut state = serializer.serialize_tuple_variant("Error", 2, "Other", 1)?;
                state.serialize_field(&other.to_string())?;
                state.end()
            }
        }
    }
}