use std::{collections::HashMap, hash::Hash}; pub struct Grid { data: HashMap, } impl Grid where Dim: Eq + PartialEq + Hash, { pub fn new() -> Self { Self { data: HashMap::new(), } } pub fn get(&self, idx: impl Into) -> Option<&T> { self.data.get(&idx.into()) } } impl Default for Grid where Dim: Eq + PartialEq + Hash, { fn default() -> Self { Self::new() } }