pub trait Predicate<K> {
// Required method
fn hash_property(&self, obj: &K) -> Option<u64>;
// Provided methods
fn fallback<F: Predicate<K>>(self, f: F) -> Fallback<Self, F>
where Self: Sized { ... }
fn combine<F: Predicate<K>>(self, f: F) -> Combine<Self, F>
where Self: Sized { ... }
}
Expand description
A predicate is a hasher of Kubernetes objects stream filtering
Required Methods§
sourcefn hash_property(&self, obj: &K) -> Option<u64>
fn hash_property(&self, obj: &K) -> Option<u64>
A predicate only needs to implement optional hashing when keys exist
Provided Methods§
sourcefn fallback<F: Predicate<K>>(self, f: F) -> Fallback<Self, F>where
Self: Sized,
fn fallback<F: Predicate<K>>(self, f: F) -> Fallback<Self, F>where
Self: Sized,
Returns a Predicate
that falls back to an alternate property if the first does not exist
§Usage
use kube::runtime::{predicates, Predicate};
let pred = predicates::generation.fallback(predicates::resource_version);
blah::<Pod>(pred);