pub mod net {
    use serde::Serialize;

    #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize)]
    pub struct MacAddress(pub [u8; 6]);

    impl MacAddress {
        #[cfg(test)]
        pub fn dummy() -> Self {
            Self([0, 0, 0, 0, 0, 0])
        }
    }

    impl From<&MacAddress> for String {
        fn from(value: &MacAddress) -> Self {
            format!(
                "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}",
                value.0[0], value.0[1], value.0[2], value.0[3], value.0[4], value.0[5]
            )
        }
    }

    impl std::fmt::Display for MacAddress {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
            f.write_fmt(format_args!("MacAddress {}", String::from(self)))
        }
    }
}
