pub trait SelectorExt: Sealed {
type Search;
// Required method
fn matches(&self, on: &Self::Search) -> bool;
}
Expand description
Selector extension trait for querying selector-like objects
Required Associated Types§
Required Methods§
sourcefn matches(&self, on: &Self::Search) -> bool
fn matches(&self, on: &Self::Search) -> bool
Perform a match check on the arbitrary components like labels
use k8s_openapi::apimachinery::pkg::apis::meta::v1::LabelSelector;
use kube::core::{SelectorExt, Selector};
let selector: Selector = LabelSelector::default().try_into()?;
let search = BTreeMap::from([("app".to_string(), "myapp".to_string())]);
selector.matches(&search);