method Map.keys
The keys, in insertion order.
Example:
fn main() io {
let m = {"b": 2, "a": 1}
print("{m.keys()}")
}Вывод
["b", "a"]
The keys, in the iteration order of the map.
Example:
fn main() io {
let m: Map<str, i32> = {"a": 1}
print("{m.keys()}")
}Вывод
["a"]
pub(api) fn keys() -> List<K>Сложность. O(n).
С версии. 1.0.0-beta
Возвращает
List<K>
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/collections.oxl:881