InstrumentAdapter

Struct InstrumentAdapter 

Source
pub struct InstrumentAdapter<L, I> { /* private fields */ }

Implementations§

Source§

impl<L, I> InstrumentAdapter<L, I>
where L: Eq + Send + 'static, I: Instrument,

Source

pub fn new(instrument: I) -> Self

Source

pub fn accept<F: Into<LabelFilter<L>>>(accept: F, instrument: I) -> Self

Source

pub fn for_label(label: L, instrument: I) -> Self

Source

pub fn for_labels(labels: Vec<L>, instrument: I) -> Self

Source

pub fn by_predicate<P>(predicate: P, instrument: I) -> Self
where P: Fn(&L) -> bool + Send + 'static,

Source

pub fn deaf(instrument: I) -> Self

Source

pub fn accept_no_labels(self) -> Self

Source

pub fn accept_all_labels(self) -> Self

Source

pub fn modify_with<F>(self, f: F) -> Self
where F: Fn(&L, Update) -> Update + Send + 'static,

Source

pub fn instrument(&self) -> &I

Trait Implementations§

Source§

impl<L, I> From<I> for InstrumentAdapter<L, I>
where L: Clone + Eq + Send + 'static, I: Instrument,

Source§

fn from(instrument: I) -> InstrumentAdapter<L, I>

Converts to this type from the input type.
Source§

impl<L, I> HandlesObservations for InstrumentAdapter<L, I>
where L: Eq + Send + 'static, I: Instrument,

Source§

type Label = L

Source§

fn handle_observation( &mut self, observation: &Observation<Self::Label>, ) -> usize

Source§

impl<L, I> PutsSnapshot for InstrumentAdapter<L, I>
where L: Send + 'static, I: Instrument,

Source§

fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)

Puts the current snapshot values into the given Snapshot thereby following the guidelines of PutsSnapshot.

Auto Trait Implementations§

§

impl<L, I> Freeze for InstrumentAdapter<L, I>
where I: Freeze, L: Freeze,

§

impl<L, I> !RefUnwindSafe for InstrumentAdapter<L, I>

§

impl<L, I> Send for InstrumentAdapter<L, I>
where I: Send, L: Send,

§

impl<L, I> !Sync for InstrumentAdapter<L, I>

§

impl<L, I> Unpin for InstrumentAdapter<L, I>
where I: Unpin, L: Unpin,

§

impl<L, I> !UnwindSafe for InstrumentAdapter<L, I>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V