pub struct Selection { /* private fields */ }Expand description
A label-based filter for selecting which metrics a query operates on. Composes by AND — every constraint must match.
Implementations§
Source§impl Selection
impl Selection
pub fn all() -> Self
Sourcepub fn with_family(self, name: impl Into<String>) -> Self
pub fn with_family(self, name: impl Into<String>) -> Self
Builder form: constrain this selection to the named family.
Sourcepub fn with_label(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_label( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Restrict to series whose LabelSet contains key=value.
Sourcepub fn with_label_containing(
self,
key: impl Into<String>,
substring: impl Into<String>,
) -> Self
pub fn with_label_containing( self, key: impl Into<String>, substring: impl Into<String>, ) -> Self
Restrict to series whose label value at key contains
substring (operator-friendly for path-style labels).
Sourcepub fn matches_family(&self, family_name: &str) -> bool
pub fn matches_family(&self, family_name: &str) -> bool
True when the selection’s family constraint matches the candidate, or there is no family constraint.
Sourcepub fn matches_labels(&self, labels: &Labels) -> bool
pub fn matches_labels(&self, labels: &Labels) -> bool
True when every label constraint is satisfied by labels.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Selection
impl RefUnwindSafe for Selection
impl Send for Selection
impl Sync for Selection
impl Unpin for Selection
impl UnsafeUnpin for Selection
impl UnwindSafe for Selection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more