Look up a key, returning a borrow of the value if present.
(&'a self, k: &Q, ctx: &Ctx)
| 104 | |
| 105 | /// Look up a key, returning a borrow of the value if present. |
| 106 | pub fn get<'a, Q, Ctx>(&'a self, k: &Q, ctx: &Ctx) -> Option<&'a V> |
| 107 | where |
| 108 | Ctx: CtxEq<K, Q> + CtxHash<Q> + CtxHash<K>, |
| 109 | { |
| 110 | let hash = compute_hash(ctx, k); |
| 111 | self.raw |
| 112 | .find(hash as u64, |bucket| { |
| 113 | hash == bucket.hash && ctx.ctx_eq(&bucket.k, k) |
| 114 | }) |
| 115 | .map(|bucket| &bucket.v) |
| 116 | } |
| 117 | |
| 118 | /// Look up a key, returning an `Entry` that refers to an existing |
| 119 | /// value or allows inserting a new one. |
nothing calls this directly
no test coverage detected