Struct rtrtr::metrics::Collection
source · [−]pub struct Collection { /* private fields */ }
Expand description
A collection of metrics sources.
This type provides a shared collection. I.e., if a value is cloned, both clones will reference the same collection. Both will see newly added sources.
Such new sources can be registered with the register
method. A string with all the current values of all known sources can be
obtained via the assemble
method.
Implementations
sourceimpl Collection
impl Collection
sourcepub fn register(&self, name: Arc<str>, source: Weak<dyn Source>)
pub fn register(&self, name: Arc<str>, source: Weak<dyn Source>)
Registers a new source with the collection.
The name of the component registering the source is passed via name
.
The source itself is given as a weak pointer so that it gets dropped
when the owning component terminates.
sourcepub fn assemble(&self, format: OutputFormat) -> String
pub fn assemble(&self, format: OutputFormat) -> String
Assembles metrics output.
Produces an output of all the sources in the collection in the given format and returns it as a string.
Trait Implementations
sourceimpl Clone for Collection
impl Clone for Collection
sourcefn clone(&self) -> Collection
fn clone(&self) -> Collection
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Collection
impl Debug for Collection
sourceimpl Default for Collection
impl Default for Collection
sourcefn default() -> Collection
fn default() -> Collection
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Collection
impl Send for Collection
impl Sync for Collection
impl Unpin for Collection
impl !UnwindSafe for Collection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more