Method in collections::map · HashMap coil-stdlib

HashMap::contains

pub fn contains(K k) -> bool
Import
use collections::map::{HashMap};
Source: src/collections/map.hy

Returns true when the map has an entry for k.

Called on a HashMap value as value.contains(…).

Parameters#

NameType
kK

Returns#

bool

Examples#

use collections::map::{HashMap};
use tests::assert;
let m: HashMap<int, bool> = HashMap::new();
m.insert(7, false);
assert!(m.contains(7));
assert!(!m.contains(8));

See also#

↑ ↓ navigate ↵ open