Struct embedded_trace::TraceTaskFuture
source · pub struct TraceTaskFuture<'a, F, I>where
F: Future,
I: Instrument,{ /* private fields */ }
Trait Implementations§
source§impl<'p, F, P> Future for TraceTaskFuture<'p, F, P>where
F: Future,
P: Instrument,
impl<'p, F, P> Future for TraceTaskFuture<'p, F, P>where
F: Future,
P: Instrument,
impl<'__pin, 'a, F, I> Unpin for TraceTaskFuture<'a, F, I>
Auto Trait Implementations§
impl<'a, F, I> RefUnwindSafe for TraceTaskFuture<'a, F, I>where
F: RefUnwindSafe,
I: RefUnwindSafe,
impl<'a, F, I> Send for TraceTaskFuture<'a, F, I>
impl<'a, F, I> Sync for TraceTaskFuture<'a, F, I>
impl<'a, F, I> !UnwindSafe for TraceTaskFuture<'a, F, I>
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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more
source§impl<F> TraceFuture for Fwhere
F: Future,
impl<F> TraceFuture for Fwhere
F: Future,
source§fn trace_task<I: Instrument>(
self,
instrument: &mut I
) -> TraceTaskFuture<'_, Self, I> ⓘ
fn trace_task<I: Instrument>( self, instrument: &mut I ) -> TraceTaskFuture<'_, Self, I> ⓘ
Trace a
Future
’s task execution. The underlying Instrument
calls on_enter
when the future is first
polled, and calls on_exit
when it completes
(returns Poll::Ready
). This is useful for analyzing the total time
it takes for your future to complete (note that this is different from
the real CPU time the task consumes).source§fn trace_poll<I: Instrument>(
self,
instrument: &mut I
) -> TracePollFuture<'_, Self, I> ⓘ
fn trace_poll<I: Instrument>( self, instrument: &mut I ) -> TracePollFuture<'_, Self, I> ⓘ
Trace a
Future
poll execution. The underlying Instrument
calls on_enter
every time prior to the
underlying future being polled, and calls and calls
on_exit
when it completes (returns
on_exit
right after the poll
call completes, regardless of whether the underlying future completed or
not. This is useful for analyzing the time it takes to poll your future
(ie, actual CPU time used).source§fn trace_task_and_poll<'a, I1: Instrument, I2: Instrument>(
self,
task_instrument: &'a mut I1,
poll_instrument: &'a mut I2
) -> TraceTaskAndPollFuture<'a, Self, I1, I2> ⓘ
fn trace_task_and_poll<'a, I1: Instrument, I2: Instrument>( self, task_instrument: &'a mut I1, poll_instrument: &'a mut I2 ) -> TraceTaskAndPollFuture<'a, Self, I1, I2> ⓘ
The first underlying
Instrument
(task_instrument
) acts exactly as
trace_task
, and the second underlying
Instrument
(poll_instrument
) acts exactly as
trace_poll
.