pub struct MetricLabelsManager { /* private fields */ }Expand description
Manages in-flight per-metric label fetches using promises.
Similar to LabelsManager, but specifically for fetching
label names and values for a single metric.
Implementations§
Source§impl MetricLabelsManager
impl MetricLabelsManager
Sourcepub fn is_fetching(&self) -> bool
pub fn is_fetching(&self) -> bool
Check if a fetch is currently in flight.
Sourcepub fn fetching_metric(&self) -> Option<&str>
pub fn fetching_metric(&self) -> Option<&str>
Get the metric name currently being fetched.
Sourcepub fn fetch<C: MetricsClient + ?Sized>(
&mut self,
client: &C,
metric: &str,
ctx: &Context,
)
pub fn fetch<C: MetricsClient + ?Sized>( &mut self, client: &C, metric: &str, ctx: &Context, )
Fetch labels for a specific metric.
If a fetch is already in flight for a different metric, it is cancelled.
Sourcepub fn poll(&mut self) -> Option<(String, MetricLabelsResult)>
pub fn poll(&mut self) -> Option<(String, MetricLabelsResult)>
Poll for the fetch result.
Returns Some((metric_name, result)) if a fetch just completed, None otherwise.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MetricLabelsManager
impl !RefUnwindSafe for MetricLabelsManager
impl Send for MetricLabelsManager
impl !Sync for MetricLabelsManager
impl Unpin for MetricLabelsManager
impl UnsafeUnpin for MetricLabelsManager
impl UnwindSafe for MetricLabelsManager
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