Skip to main content

Injector

Trait Injector 

pub trait Injector {
    // Required method
    fn set(&mut self, key: &str, value: String);

    // Provided method
    fn reserve(&mut self, additional: usize) { ... }
}
Available on crate features opentelemetry and trace only.
Expand description

Injector provides an interface for adding fields from an underlying struct like HashMap

Required Methods§

fn set(&mut self, key: &str, value: String)

Add a key and value to the underlying data.

Provided Methods§

fn reserve(&mut self, additional: usize)

Hint to reserve capacity for at least additional more entries to be inserted.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

§

impl<S> Injector for HashMap<String, String, S>
where S: BuildHasher,