Skip to main content

AttributeFactory

Trait AttributeFactory 

Source
pub trait AttributeFactory {
    type Attribute: Sized;

    // Required methods
    fn create_i64(&self, key: &'static str, value: i64) -> Self::Attribute;
    fn create_f64(&self, key: &'static str, value: f64) -> Self::Attribute;
    fn create_string(
        &self,
        key: &'static str,
        value: Cow<'static, str>,
    ) -> Self::Attribute;
}
Expand description

A trait for creating sampling attributes.

This trait abstracts the creation of attributes for sampling tags, allowing different implementations for different attribute types.

Required Associated Types§

Source

type Attribute: Sized

The type of attribute created by this factory.

Required Methods§

Source

fn create_i64(&self, key: &'static str, value: i64) -> Self::Attribute

Creates an attribute with an i64 value.

Source

fn create_f64(&self, key: &'static str, value: f64) -> Self::Attribute

Creates an attribute with an f64 value.

Source

fn create_string( &self, key: &'static str, value: Cow<'static, str>, ) -> Self::Attribute

Creates an attribute with a string value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§