pub trait ResultCache {
// Required methods
fn key(&self, key: &ResultCacheKey<'_>) -> u64;
fn put(&mut self, key: u64, result: &Result<(), TestCaseError>);
fn get(&self, key: u64) -> Option<&Result<(), TestCaseError>>;
}Expand description
An object which can cache the outcomes of tests.
Required Methods§
Sourcefn key(&self, key: &ResultCacheKey<'_>) -> u64
fn key(&self, key: &ResultCacheKey<'_>) -> u64
Convert the given cache key into a u64 representing that value. The
u64 is used as the key below.
This is a separate step so that ownership of the key value can be handed off to user code without needing to be able to clone it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".