pub struct REGISTRY { /* private fields */ }Methods from Deref<Target = Registry>§
Sourcepub fn register(&self, c: Box<dyn Collector>) -> Result<(), Error>
pub fn register(&self, c: Box<dyn Collector>) -> Result<(), Error>
register registers a new Collector to be included in metrics
collection. It returns an error if the descriptors provided by the
Collector are invalid or if they — in combination with descriptors of
already registered Collectors — do not fulfill the consistency and
uniqueness criteria described in the documentation of Desc.
If the provided Collector is equal to a Collector already registered
(which includes the case of re-registering the same Collector), the
AlreadyReg error returns.
Sourcepub fn gather(&self) -> Vec<MetricFamily>
pub fn gather(&self) -> Vec<MetricFamily>
gather calls the Collect method of the registered Collectors and then
gathers the collected metrics into a lexicographically sorted slice
of MetricFamily protobufs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for REGISTRY
impl RefUnwindSafe for REGISTRY
impl Send for REGISTRY
impl Sync for REGISTRY
impl Unpin for REGISTRY
impl UnwindSafe for REGISTRY
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