MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / within_bound

Method within_bound

fendermint/vm/topdown/src/cache.rs:69–77  ·  view source on GitHub ↗
(&self, k: K)

Source from the content-addressed store, hash-verified

67 }
68
69 fn within_bound(&self, k: K) -> bool {
70 match (self.lower_bound(), self.upper_bound()) {
71 (Some(lower), Some(upper)) => lower <= k && k <= upper,
72 (None, None) => false,
73 // other states are not reachable, even if there is one entry, both upper and
74 // lower bounds should be the same, both should be Some.
75 _ => unreachable!(),
76 }
77 }
78
79 pub fn get_value(&self, key: K) -> Option<&V> {
80 if !self.within_bound(key) {

Callers 1

get_valueMethod · 0.80

Calls 2

lower_boundMethod · 0.80
upper_boundMethod · 0.80

Tested by

no test coverage detected