init Map.new
True when the map has no entries.
Example:
fn main() io {
let m: Map<str, i32> = {:}
print("{m.isEmpty()}")
}Вывод
true
Number of entries.
Example:
fn main() io {
let m: Map<str, i32> = {"a": 1, "b": 2}
print("{m.len()}")
}Вывод
2
An empty map.
Example:
fn main() io {
let m = Map<str, i32>.new()
print("{m.len()}")
}Вывод
0
pub(api) init new() -> SelfС версии. 1.0.0-beta
Возвращает
Self
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/collections.oxl:603