The crate CHashMap is puzzling me. Why does it only have into_iter
, but not iter
or iter_mut
? I just want to be able to loop through and do something like this (wherein there is dependency upon one of the T
's inner fields, but not the key which maps to T
within the hashmap itself)
/// Returns a client by IP Address
pub fn get_client_by_addr(&self, addr: &IpAddr, prefer_ipv6: bool) -> Option<ClientNetworkAccount> {
for cnac in self.map.iter() {
if let Some(ip) = cnac.read().nac.get_addr(prefer_ipv6) {
if ip.eq(addr) {
return Some(cnac.clone())
}
}
}
None
}