pub enum MetricNamespaceScoping {
None,
Some(MetricNamespace),
Any,
}
Expand description
Describes the metric namespace scoping of an item.
This enum is used within ItemScoping
to represent the metric namespace of an item.
It handles the different cases: no namespace, a specific namespace, or any namespace.
Variants§
None
The item does not contain metrics of any namespace.
This should only be used for non-metric items.
Some(MetricNamespace)
The item contains metrics of a specific namespace.
Any
The item contains metrics of any namespace.
The specific namespace is not known or relevant. This can be used to check rate limits or quotas that should apply to any namespace.
Implementations§
Source§impl MetricNamespaceScoping
impl MetricNamespaceScoping
Sourcepub fn matches(&self, namespace: MetricNamespace) -> bool
pub fn matches(&self, namespace: MetricNamespace) -> bool
Checks if the given namespace matches this namespace scoping.
Returns true
in the following cases:
- If
self
isMetricNamespaceScoping::Some
with the same namespace - If
self
isMetricNamespaceScoping::Any
, matching any namespace
Trait Implementations§
Source§impl Clone for MetricNamespaceScoping
impl Clone for MetricNamespaceScoping
Source§fn clone(&self) -> MetricNamespaceScoping
fn clone(&self) -> MetricNamespaceScoping
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MetricNamespaceScoping
impl Debug for MetricNamespaceScoping
Source§impl Default for MetricNamespaceScoping
impl Default for MetricNamespaceScoping
Source§fn default() -> MetricNamespaceScoping
fn default() -> MetricNamespaceScoping
Returns the “default value” for a type. Read more
Source§impl From<MetricNamespace> for MetricNamespaceScoping
impl From<MetricNamespace> for MetricNamespaceScoping
Source§fn from(namespace: MetricNamespace) -> Self
fn from(namespace: MetricNamespace) -> Self
Converts to this type from the input type.
Source§impl Hash for MetricNamespaceScoping
impl Hash for MetricNamespaceScoping
Source§impl PartialEq for MetricNamespaceScoping
impl PartialEq for MetricNamespaceScoping
Source§impl PartialOrd for MetricNamespaceScoping
impl PartialOrd for MetricNamespaceScoping
impl Copy for MetricNamespaceScoping
impl Eq for MetricNamespaceScoping
impl StructuralPartialEq for MetricNamespaceScoping
Auto Trait Implementations§
impl Freeze for MetricNamespaceScoping
impl RefUnwindSafe for MetricNamespaceScoping
impl Send for MetricNamespaceScoping
impl Sync for MetricNamespaceScoping
impl Unpin for MetricNamespaceScoping
impl UnwindSafe for MetricNamespaceScoping
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more