pub trait Configuration {
    type Jar: for<'db> Jar<'db>;
    type SalsaStruct: for<'db> SalsaStructInDb<DynDb<'db, Self>>;
    type Key: AsId;
    type Value: Debug;

    const CYCLE_STRATEGY: CycleRecoveryStrategy;

    fn should_backdate_value(
        old_value: &Self::Value,
        new_value: &Self::Value
    ) -> bool; fn execute(db: &DynDb<'_, Self>, key: Self::Key) -> Self::Value; fn recover_from_cycle(
        db: &DynDb<'_, Self>,
        cycle: &Cycle,
        key: Self::Key
    ) -> Self::Value; fn key_from_id(id: Id) -> Self::Key { ... } }

Required Associated Types

The “salsa struct type” that this function is associated with. This can be just salsa::Id for functions that intern their arguments and are not clearly associated with any one salsa struct.

What key is used to index the memo. Typically a salsa struct id, but if this memoized function has multiple arguments it will be a salsa::Id that results from interning those arguments.

The value computed by the function.

Required Associated Constants

Determines whether this function can recover from being a participant in a cycle (and, if so, how).

Required Methods

Invokes after a new result new_value`` has been computed for which an older memoized value existed old_value`. Returns true if the new value is equal to the older one and hence should be “backdated” (i.e., marked as having last changed in an older revision, even though it was recomputed).

This invokes user’s code in form of the Eq impl.

Invoked when we need to compute the value for the given key, either because we’ve never computed it before or because the old one relied on inputs that have changed.

This invokes the function the user wrote.

If the cycle strategy is Recover, then invoked when key is a participant in a cycle to find out what value it should have.

This invokes the recovery function given by the user.

Provided Methods

Given a salsa Id, returns the key. Convenience function to avoid having to type <C::Key as AsId>::from_id.

Implementors