Map
Associated Functions for the Map type
Built-in associated functions for the Map<K, V, N> type.
A hash map with fixed capacity for storing key-value pairs.
Key Operations
has
fn has(self, key: K) -> Bool
Returns true if the map contains the specified key.
remove
fn remove(mut self, key: K)
Removes the key-value pair associated with the specified key.
Views
keys
fn keys(self) -> [K]
Returns a slice view of all keys in the map.
values
fn values(self) -> [V]
Returns a slice view of all values in the map.
Size & Capacity
len
fn len(self) -> Int
Returns the number of key-value pairs in the map.
capacity
fn capacity(self) -> Int
Returns the maximum number of key-value pairs the map can hold.
is_empty
fn is_empty(self) -> Bool
Returns true if the map contains no key-value pairs.
clear
fn clear(mut self)
Removes all key-value pairs from the map.