Trait ConsistencyCheck

Source
pub trait ConsistencyCheck: Clone + Default {
    // Required method
    fn check_consistency<T: PartialEq + Debug, Input>(
        &self,
        cache: T,
        input: &Input,
        query: fn(&Input) -> T,
    );
}
Expand description

Trait to configure consistency checking behavior

Required Methods§

Source

fn check_consistency<T: PartialEq + Debug, Input>( &self, cache: T, input: &Input, query: fn(&Input) -> T, )

Called when the Memo struct has a cached value

An implementation can assert that the cache value matches the current query result

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§