MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / get

Method get

publication/code/chapter06/hashmap.rs:165–168  ·  view source on GitHub ↗

获取 val 的引用及可变引用

(&self, key: usize)

Source from the content-addressed store, hash-verified

163
164 // 获取 val 的引用及可变引用
165 fn get(&self, key: usize) -> Option<&T> {
166 let curr = self.get_pos(key);
167 self.data.get(curr)
168 }
169
170 fn get_mut(&mut self, key: usize) -> Option<&mut T> {
171 let curr = self.get_pos(key);

Callers

nothing calls this directly

Calls 1

get_posMethod · 0.80

Tested by

no test coverage detected