1 2 3 4 5 6 7 8 9 10 11 12
use serde::{ Deserialize, Serialize }; /// Opaque key identifier. /// You may map this to scan codes, HID usages, etc. #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct KeyId(pub String); impl<K: Into<String>> From<K> for KeyId { fn from(k: K) -> Self { KeyId(k.into()) } }