Struct metrics_util::CompositeKey [−][src]
pub struct CompositeKey(_, _);
Expand description
A composite key that stores both the metric key and the metric kind.
This type is intended to be used by recorders that internally take advantage of
the provided Registry
type when also using
Handle
.
Since handles are opaque, having the standard key by itself could lead to two
different metric kinds tryin to use the same key, calling read or write methods
that inevitably panic. With CompositeKey
, the kind can tied to the underlying
handle, ensuring parity between the two.
Implementations
impl CompositeKey
[src]
impl CompositeKey
[src]pub const fn new(kind: MetricKind, key: Key) -> CompositeKey
[src]
pub const fn new(kind: MetricKind, key: Key) -> CompositeKey
[src]Creates a new CompositeKey
.
pub fn kind(&self) -> MetricKind
[src]
pub fn kind(&self) -> MetricKind
[src]Gets the inner kind represented by this CompositeKey
.
pub fn into_parts(self) -> (MetricKind, Key)
[src]
pub fn into_parts(self) -> (MetricKind, Key)
[src]Takes the individual pieces of this CompositeKey
.
Trait Implementations
impl Clone for CompositeKey
[src]
impl Clone for CompositeKey
[src]fn clone(&self) -> CompositeKey
[src]
fn clone(&self) -> CompositeKey
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for CompositeKey
[src]
impl Debug for CompositeKey
[src]impl Hash for CompositeKey
[src]
impl Hash for CompositeKey
[src]impl Ord for CompositeKey
[src]
impl Ord for CompositeKey
[src]impl PartialEq<CompositeKey> for CompositeKey
[src]
impl PartialEq<CompositeKey> for CompositeKey
[src]fn eq(&self, other: &CompositeKey) -> bool
[src]
fn eq(&self, other: &CompositeKey) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &CompositeKey) -> bool
[src]
fn ne(&self, other: &CompositeKey) -> bool
[src]This method tests for !=
.
impl PartialOrd<CompositeKey> for CompositeKey
[src]
impl PartialOrd<CompositeKey> for CompositeKey
[src]fn partial_cmp(&self, other: &CompositeKey) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &CompositeKey) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for CompositeKey
[src]
impl StructuralEq for CompositeKey
[src]
impl StructuralPartialEq for CompositeKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for CompositeKey
impl Send for CompositeKey
impl Sync for CompositeKey
impl Unpin for CompositeKey
impl UnwindSafe for CompositeKey
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
[src]
impl<T> Pointable for T
[src]impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more