use std::collections::hash_map::{HashMap, Keys, Values, Iter};
use std::iter::Iterator;
use super::abc::*;
impl <'a> Type for HashMap<EntityId, BType<'a>> {
fn to_bool(&self) -> bool { !self.is_empty() }
}
impl <'a> IClone for HashMap<EntityId, BType<'a>> {
fn iclone<'b>(&self) -> Result<BType<'b>, CloneError> {
let cloned: HashMap<EntityId, BType<'b>> = HashMap::new();
for (k, v) in self.iter() {
cloned.insert(k, v.iclone()?);
}
Ok( Box::new(cloned) )
}
}
impl <'a, 'b: 'a> IIterable<'a> for HashMap<EntityId, BType<'a>> {
fn is_empty(&self) -> bool {
HashMap::is_empty(self)
}
fn ivalues(&self) -> VIterator {
VIterator { me: self.values() }
}
}