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§fn eq(&self, other: &MetricNamespaceScoping) -> bool
fn eq(&self, other: &MetricNamespaceScoping) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for MetricNamespaceScoping
impl PartialOrd for MetricNamespaceScoping
source§fn partial_cmp(&self, other: &MetricNamespaceScoping) -> Option<Ordering>
fn partial_cmp(&self, other: &MetricNamespaceScoping) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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