Trait rustc_typeck::util::common::MemoizationMap [] [src]

pub trait MemoizationMap {
    type Key: Clone;
    type Value: Clone;
    fn memoize<OP>(&self, key: Self::Key, op: OP) -> Self::Value where OP: FnOnce() -> Self::Value;
}
🔬 This is a nightly-only experimental API. (rustc_private)

Associated Types

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

Required Methods

🔬 This is a nightly-only experimental API. (rustc_private)

If key is present in the map, return the valuee, otherwise invoke op and store the value in the map.

NB: if the receiver is a DepTrackingMap, special care is needed in the op to ensure that the correct edges are added into the dep graph. See the DepTrackingMap impl for more details!

Implementors