pub enum MetricNamespaceScoping {
None,
Some(MetricNamespace),
Any,
}
Expand description
Item scoping of metric namespaces.
This enum is used in ItemScoping
to declare the contents of an item’s metric namespace.
Variants§
None
This item does not contain metrics of any namespace. This should only be used for non-metric items.
Some(MetricNamespace)
This item contains metrics of a specific namespace.
Any
This item contains metrics of any namespace.
The namespace of metrics contained in this item is not known. This can be used to check rate limits or quotas of any namespace.
Implementations§
source§impl MetricNamespaceScoping
impl MetricNamespaceScoping
sourcepub fn matches(&self, namespace: MetricNamespace) -> bool
pub fn matches(&self, namespace: MetricNamespace) -> bool
Returns true
if the given namespace matches the namespace of the item.
If the self is Any
, this method returns true
for 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 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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