Method in collections::tree · TreeMap coil-stdlib

TreeMap::get

pub fn get(K k) -> Option<V>
Import
use collections::tree::{TreeMap};
Source: src/collections/tree.hy

Returns the value stored under k, or None when there is none.

Called on a TreeMap value as value.get(…).

Parameters#

NameType
kK

Returns#

Option<V>

Examples#

use collections::tree::{TreeMap};
use tests::assert;
let m: TreeMap<string, int> = TreeMap::new();
m.insert("a", 1);
assert!((m.get("a") ?? 0) == 1);
assert!(m.get("b").is_none());

See also#

↑ ↓ navigate ↵ open