use std::collections::hash_map::{HashMap, Keys, Values, Iter};
use std::iter::Iterator;
use abc::CloneError;
use super::abc::*;
impl <'a> Type for HashMap<EntityId, BType<'a>> {
fn to_bool(self: &Self) -> bool { !self.is_empty() }
}
impl <'a> IClone for HashMap<EntityId, BType<'a>> {
fn iclone<'b>(self: &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> IIter<'a> for HashMap<EntityId, BType<'a>> {
fn is_empty(self: &Self) -> bool {
HashMap::is_empty(self)
}
fn ivalues(self: &Self) -> VIterator {
VIterator { me: self.values() }
}
}