Trait stretto::UpdateValidator
source · [−]pub trait UpdateValidator<V>: Send + Sync + 'static {
fn should_update(&self, prev: &V, curr: &V) -> bool;
}Expand description
By default, the Cache will always update the value if the value already exists in the cache, this trait is for you to check if the value should be updated.
Required methods
fn should_update(&self, prev: &V, curr: &V) -> bool
fn should_update(&self, prev: &V, curr: &V) -> bool
should_update is called when a value already exists in cache and is being updated.