pub enum AsyncRunner {
F64(Box<dyn Fn(ObserverResult<f64>) + Send + Sync>),
I64(Box<dyn Fn(ObserverResult<i64>) + Send + Sync>),
U64(Box<dyn Fn(ObserverResult<u64>) + Send + Sync>),
Batch(Box<dyn Fn(BatchObserverResult) + Send + Sync>),
}
Available on crate feature
metrics
only.Expand description
Called when collecting async instruments
Variants§
F64(Box<dyn Fn(ObserverResult<f64>) + Send + Sync>)
Callback for f64
observed values
I64(Box<dyn Fn(ObserverResult<i64>) + Send + Sync>)
Callback for i64
observed values
U64(Box<dyn Fn(ObserverResult<u64>) + Send + Sync>)
Callback for u64
observed values
Batch(Box<dyn Fn(BatchObserverResult) + Send + Sync>)
Callback for batch observed values
Implementations§
Source§impl AsyncRunner
impl AsyncRunner
Sourcepub fn run(
&self,
instrument: &Option<Arc<dyn AsyncInstrumentCore>>,
f: fn(&[KeyValue], &[Observation]),
)
pub fn run( &self, instrument: &Option<Arc<dyn AsyncInstrumentCore>>, f: fn(&[KeyValue], &[Observation]), )
Run accepts a single instrument and function for capturing observations of that instrument. Each call to the function receives one captured observation. (The function accepts multiple observations so the same implementation can be used for batch runners.)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AsyncRunner
impl !RefUnwindSafe for AsyncRunner
impl Send for AsyncRunner
impl Sync for AsyncRunner
impl Unpin for AsyncRunner
impl !UnwindSafe for AsyncRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Available on crate feature
trace
only.Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Available on crate feature
trace
only.