Trait ProvideMeter

Source
pub trait ProvideMeter:
    Send
    + Sync
    + Debug {
    // Required method
    fn get_meter(
        &self,
        scope: &'static str,
        attributes: Option<&Attributes>,
    ) -> Meter;

    // Provided methods
    fn as_any(&self) -> &dyn Any { ... }
    fn provider_name(&self) -> &'static str { ... }
}
Expand description

Provides named instances of Meter.

Required Methods§

Source

fn get_meter( &self, scope: &'static str, attributes: Option<&Attributes>, ) -> Meter

Get or create a named Meter.

Provided Methods§

Source

fn as_any(&self) -> &dyn Any

Returns a reference to self as &dyn Any for downcasting.

The default implementation returns a reference to the unit type, which will fail any downcast attempts. Implementations should override this to return self for proper type inspection.

Source

fn provider_name(&self) -> &'static str

Returns the name of this provider implementation. This is used for feature tracking without requiring type imports.

Implementors§