[][src]Trait metrics_core::Builder

pub trait Builder {
    type Output: Observer;
    fn build(&self) -> Self::Output;
}

A value that can build an observer.

Observers are containers used for rendering a snapshot in a particular format. As many systems are multi-threaded, we can't easily share a single recorder amongst multiple threads, and so we create a recorder per observation, tying them together.

A builder allows us to generate an observer on demand, giving each specific recorder an interface by which they can do any necessary configuration, initialization, etc of the observer before handing it over to the exporter.

Associated Types

type Output: Observer

The observer created by this builder.

Loading content...

Required methods

fn build(&self) -> Self::Output

Creates a new recorder.

Loading content...

Implementors

Loading content...