std.map.Entry
type pub Entry[K: Equal + Hash, V]
An entry stored in a Map.
Fields
value
let pub @value: V
The value of the key.
Instance methods
clone
Show source codeHide source code
fn pub clone -> Entry[move K, move V] {
Entry(
key: @key.clone,
value: @value.clone,
hash: @hash,
distance: @distance,
)
}
fn pub clone -> Entry[move K, move V]
if
K: Equal + Hash + Clone,
V: Clone
Creates a clone of self
.
The returned value is an owned value that is the same type as the receiver
of this method. For example, cloning a ref Array[Int]
results in a
Array[Int]
, not another ref Array[Int]
.
key
Show source codeHide source code
fn pub key -> ref K {
@key
}
fn pub key -> ref K
Returns an immutable reference to the key.
Keys can never be mutated in place, as this can result in map lookups returning unexpected results.
Implemented traits
Clone
impl Clone for Entry
if
K: Equal + Hash + Clone,
V: Clone