Trait Builder

Source
pub trait Builder {
    type Output: Observer;

    // Required method
    fn build(&self) -> Self::Output;
}
Expand description

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.

Required Associated Types§

Source

type Output: Observer

The observer created by this builder.

Required Methods§

Source

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

Creates a new recorder.

Implementors§