MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / get_mut

Method get_mut

crates/data-structures/src/small_map.rs:184–189  ·  view source on GitHub ↗

Returns the value for `key`, mutably, if any.

(&mut self, key: &K)

Source from the content-addressed store, hash-verified

182
183 /// Returns the value for `key`, mutably, if any.
184 pub fn get_mut(&mut self, key: &K) -> Option<&mut V> {
185 match self {
186 Self::Small(list) => list.iter_mut().find_map(|(k, v)| (k == key).then_some(v)),
187 Self::Large(map) => map.get_mut(key),
188 }
189 }
190}
191
192impl<K: Eq + Hash, V, const N: usize, const M: usize> Extend<(K, V)> for SmallHashMap<K, V, N, M> {

Callers 11

set_truncatesMethod · 0.45
set_ephemeral_tablesMethod · 0.45
st_column_changedMethod · 0.45
insertMethod · 0.45
removeMethod · 0.45
get_sequence_mutMethod · 0.45

Calls 1

iter_mutMethod · 0.45

Tested by

no test coverage detected