use serde::{Deserialize, Serialize};
pub trait CustomSerializer<T> {
fn to_json_string(&self) -> String
where
Self: Serialize,
Self: Sized,
{
serde_json::to_string(&self).expect("Error during serialization")
}
fn from_json_string(data_string: String) -> T
where
T: for<'a> Deserialize<'a>,
{
serde_json::from_str(&data_string).expect("Error during deserialization")
}
}
pub trait IMacVendorCache {
fn new() -> Self;
fn add(&self, mac_addr: String, vendor_name: String);
fn contains(&self, mac_addr: &String) -> bool;
fn get(&self, mac_addr: &String) -> String;
fn length(&self) -> usize;
}