Skip to main content

Instrumented

Struct Instrumented 

Source
pub struct Instrumented<T> { /* private fields */ }
Expand description

A stop policy or progress sink whose calls are recorded in a span.

It is 'static whenever the wrapped value is, so it can go wherever the original went: into a codec context, a spawned thread, or an Arc<dyn Stop>. may_stop and may_report always return true, so callers that skip no-op policies still make the calls being measured.

Implementations§

Source§

impl<T> Instrumented<T>

Source

pub fn inner(&self) -> &T

The wrapped value. Calls made through it are not recorded.

Trait Implementations§

Source§

impl<T: Clone> Clone for Instrumented<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Instrumented<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Report> Report for Instrumented<T>

Source§

fn advance(&self, completed: u64)

Add completed finished units.
Source§

fn may_report(&self) -> bool

Whether reports have any effect. Read more
Source§

impl<T: Stop> Stop for Instrumented<T>

Source§

fn check(&self) -> Result<(), StopReason>

Check if the operation should stop. Read more
Source§

fn should_stop(&self) -> bool

Returns true if the operation should stop. Read more
Source§

fn may_stop(&self) -> bool

Returns true if this stop can ever signal a stop. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Instrumented<T>

§

impl<T> !UnwindSafe for Instrumented<T>

§

impl<T> Freeze for Instrumented<T>
where T: Freeze,

§

impl<T> Send for Instrumented<T>
where T: Send,

§

impl<T> Sync for Instrumented<T>
where T: Sync,

§

impl<T> Unpin for Instrumented<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Instrumented<T>
where T: UnsafeUnpin,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ProgressExt for T
where T: Stop + Report + ?Sized,

Source§

fn step(&self, completed: u64) -> Result<(), StopReason>

Count completed finished units, then check for cancellation. Read more
Source§

fn live(&self) -> Option<&Self>

The live pulse: this value, or None when it can neither stop nor report. Read more
Source§

fn split_array<const N: usize>( &self, execution: Execution, parts: [PhaseSpec<'_>; N], ) -> Result<[Child<'_>; N], PlanError>
where Self: Pulse,

Pulse::split into exactly N children, returned as an array. Read more
Source§

impl<T> ReportExt for T
where T: Report + ?Sized,

Source§

fn batched(self, threshold: NonZero<u64>) -> Batch<Self>
where Self: Sized,

Buffer one worker’s reports, publishing them in batches of at least threshold units, and the remainder on Batch::flush or drop. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.