#[non_exhaustive]pub struct AsyncInstrumentBuilder<'a, T, M> {
pub callback: Arc<dyn Fn(&dyn AsyncMeasure<Value = M>) + Send + Sync>,
/* private fields */
}
Expand description
Configuration for building an async instrument.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.callback: Arc<dyn Fn(&dyn AsyncMeasure<Value = M>) + Send + Sync>
The callback function for this AsyncInstrumentBuilder.
Implementations§
source§impl<'a, T, M> AsyncInstrumentBuilder<'a, T, M>
impl<'a, T, M> AsyncInstrumentBuilder<'a, T, M>
sourcepub fn get_callback(
&self,
) -> Arc<dyn Fn(&dyn AsyncMeasure<Value = M>) + Send + Sync>
pub fn get_callback( &self, ) -> Arc<dyn Fn(&dyn AsyncMeasure<Value = M>) + Send + Sync>
Get the callback function.
sourcepub fn set_description(self, description: impl Into<Cow<'static, str>>) -> Self
pub fn set_description(self, description: impl Into<Cow<'static, str>>) -> Self
Set the description.
sourcepub fn get_description(&self) -> &Option<Cow<'static, str>>
pub fn get_description(&self) -> &Option<Cow<'static, str>>
Get the description.
source§impl<'a> AsyncInstrumentBuilder<'a, Arc<dyn AsyncMeasure<Value = f64>>, f64>
impl<'a> AsyncInstrumentBuilder<'a, Arc<dyn AsyncMeasure<Value = f64>>, f64>
sourcepub fn build(self) -> Arc<dyn AsyncMeasure<Value = f64>>
pub fn build(self) -> Arc<dyn AsyncMeasure<Value = f64>>
Create a new Arc<dyn AsyncMeasure<Value = f64>>
.
source§impl<'a> AsyncInstrumentBuilder<'a, Arc<dyn AsyncMeasure<Value = i64>>, i64>
impl<'a> AsyncInstrumentBuilder<'a, Arc<dyn AsyncMeasure<Value = i64>>, i64>
sourcepub fn build(self) -> Arc<dyn AsyncMeasure<Value = i64>>
pub fn build(self) -> Arc<dyn AsyncMeasure<Value = i64>>
Create a new Arc<dyn AsyncMeasure<Value = i64>>
.
source§impl<'a> AsyncInstrumentBuilder<'a, Arc<dyn AsyncMeasure<Value = u64>>, u64>
impl<'a> AsyncInstrumentBuilder<'a, Arc<dyn AsyncMeasure<Value = u64>>, u64>
sourcepub fn build(self) -> Arc<dyn AsyncMeasure<Value = u64>>
pub fn build(self) -> Arc<dyn AsyncMeasure<Value = u64>>
Create a new Arc<dyn AsyncMeasure<Value = u64>>
.
Auto Trait Implementations§
impl<'a, T, M> Freeze for AsyncInstrumentBuilder<'a, T, M>
impl<'a, T, M> !RefUnwindSafe for AsyncInstrumentBuilder<'a, T, M>
impl<'a, T, M> Send for AsyncInstrumentBuilder<'a, T, M>where
T: Send,
impl<'a, T, M> Sync for AsyncInstrumentBuilder<'a, T, M>where
T: Sync,
impl<'a, T, M> Unpin for AsyncInstrumentBuilder<'a, T, M>where
T: Unpin,
impl<'a, T, M> !UnwindSafe for AsyncInstrumentBuilder<'a, T, M>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.