pub(crate) fn cache_get_or_insert_with<K, F>(&self, key: K, mut f: F) -> RefMut<'_, K::Value>
    where
        K: 'static + TypedMapKey<CircuitStoreMarker>,
        F: FnMut() -> K::Value,
    {
        // Don't use `store.entry()`, since `f` may need to perform
        // its own cache lookup.
        if self.inner().store.contains_key(&key) {
            return RefMut::map(self.inner_mut(), |c| c.store.get_mut(&key).unwrap());
        }

        let new = f();

        // TODO: Use `RefMut::filter_map()` to only perform one lookup in the happy path
        //       https://github.com/rust-lang/rust/issues/81061
        RefMut::map(self.inner_mut(), |c| c.store.entry(key).or_insert(new))
    }
/// Lookup a value in the circuit cache or create and insert a new value
/// if it does not exist.
///
/// See [`cache`] module documentation for details.
Lookup a value in the circuit cache or create and insert a new value
if it does not exist.

See [`cache`] module documentation for details.
Lookup a value in the circuit cache or create and insert a new value if it does not exist . See [ ` cache ` ] module documentation for details .
pub(crate) fn cache_get_or_insert_with<K, F>(&self, key: K, mut f: F) -> RefMut<'_, K::Value>
    where
        K: 'static + TypedMapKey<CircuitStoreMarker>,
        F: FnMut() -> K::Value,
    {
        // Don't use `store.entry()`, since `f` may need to perform
        // its own cache lookup.
        if self.inner().store.contains_key(&key) {
            return RefMut::map(self.inner_mut(), |c| c.store.get_mut(&key).unwrap());
        }
        let new = f();
        // TODO: Use `RefMut::filter_map()` to only perform one lookup in the happy path
        //       https://github.com/rust-lang/rust/issues/81061
        RefMut::map(self.inner_mut(), |c| c.store.entry(key).or_insert(new))
    }
pub ( crate ) fn cache_get_or_insert_with < K , F > ( & self , key : K , mut f : F ) -> RefMut < ' _ , K :: Value > where K : ' static + TypedMapKey < CircuitStoreMarker > , F : FnMut ( ) -> K :: Value , { // Don't use `store.entry()`, since `f` may need to perform // its own cache lookup. if self . inner ( ) . store . contains_key ( & key ) { return RefMut :: map ( self . inner_mut ( ) , | c | c . store . get_mut ( & key ) . unwrap ( ) ) ; } let new = f ( ) ; // TODO: Use `RefMut::filter_map()` to only perform one lookup in the happy path //       https://github.com/rust-lang/rust/issues/81061 RefMut :: map ( self . inner_mut ( ) , | c | c . store . entry ( key ) . or_insert ( new ) ) }
Lookup a value in the circuit cache or create and insert a new value
if it does not exist.
Lookup a value in the circuit cache or create and insert a new value if it does not exist .
&self
key
K
f
F