Struct Instrumented
pub struct Instrumented<T> { /* private fields */ }
Expand description
A Future
that has been instrumented with a tracing
Span
.
This type is returned by the Instrument
extension trait. See that
trait’s documentation for details.
Implementations§
§impl<T> Instrumented<T>
impl<T> Instrumented<T>
pub fn span(&self) -> &Span
Available on crate feature cpu_os_threads
only.
pub fn span(&self) -> &Span
cpu_os_threads
only.Borrows the Span
that this type is instrumented by.
pub fn span_mut(&mut self) -> &mut Span
Available on crate feature cpu_os_threads
only.
pub fn span_mut(&mut self) -> &mut Span
cpu_os_threads
only.Mutably borrows the Span
that this type is instrumented by.
pub fn inner_mut(&mut self) -> &mut T
Available on crate feature cpu_os_threads
only.
pub fn inner_mut(&mut self) -> &mut T
cpu_os_threads
only.Mutably borrows the wrapped type.
pub fn inner_pin_ref(self: Pin<&Instrumented<T>>) -> Pin<&T>
Available on crate feature cpu_os_threads
only.
pub fn inner_pin_ref(self: Pin<&Instrumented<T>>) -> Pin<&T>
cpu_os_threads
only.Get a pinned reference to the wrapped type.
pub fn inner_pin_mut(self: Pin<&mut Instrumented<T>>) -> Pin<&mut T>
Available on crate feature cpu_os_threads
only.
pub fn inner_pin_mut(self: Pin<&mut Instrumented<T>>) -> Pin<&mut T>
cpu_os_threads
only.Get a pinned mutable reference to the wrapped type.
pub fn into_inner(self) -> T
Available on crate feature cpu_os_threads
only.
pub fn into_inner(self) -> T
cpu_os_threads
only.Consumes the Instrumented
, returning the wrapped type.
Note that this drops the span.
Trait Implementations§
§impl<T> Clone for Instrumented<T>where
T: Clone,
impl<T> Clone for Instrumented<T>where
T: Clone,
§fn clone(&self) -> Instrumented<T> ⓘ
fn clone(&self) -> Instrumented<T> ⓘ
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<T> Debug for Instrumented<T>where
T: Debug,
impl<T> Debug for Instrumented<T>where
T: Debug,
§impl<T> Drop for Instrumented<T>
impl<T> Drop for Instrumented<T>
§impl<T> Future for Instrumented<T>where
T: Future,
impl<T> Future for Instrumented<T>where
T: Future,
§fn poll(
self: Pin<&mut Instrumented<T>>,
cx: &mut Context<'_>,
) -> Poll<<Instrumented<T> as Future>::Output>
fn poll( self: Pin<&mut Instrumented<T>>, cx: &mut Context<'_>, ) -> Poll<<Instrumented<T> as Future>::Output>
Attempts to resolve the future to a final value, registering
the current task for wakeup if the value is not yet available. Read more
impl<'__pin, T> Unpin for Instrumented<T>where
<PinnedFieldsOfHelperStruct<__Origin<'__pin, T>> as PinnedFieldsOfHelperTrait>::Actual: Unpin,
Auto Trait Implementations§
impl<T> Freeze for Instrumented<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Instrumented<T>
impl<T> Send for Instrumented<T>where
T: Send,
impl<T> Sync for Instrumented<T>where
T: Sync,
impl<T> !UnwindSafe for Instrumented<T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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 moreSource§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.