Struct InRootSpan

Source
pub struct InRootSpan<F> { /* private fields */ }
Expand description

InRootSpan provides similar features like fastrace::future::InSpan with more controls.

Implementations§

Source§

impl<F> InRootSpan<F>

Source

pub fn new(inner: F, root: Span) -> Self
where F: Future,

Create a traced future with the given root span.

Source

pub fn with_threshold(self, threshold: Duration) -> Self

Set record threshold for the root span.

If the duration of the root span is lower than the threshold, the root span will not be recorded.

Trait Implementations§

Source§

impl<F> Deref for InRootSpan<F>

Source§

type Target = F

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<F> Future for InRootSpan<F>
where F: Future,

Source§

type Output = <F as Future>::Output

The type of value produced on completion.
Source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::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
Source§

impl<'pin, F> Unpin for InRootSpan<F>
where PinnedFieldsOf<__InRootSpan<'pin, F>>: Unpin,

Auto Trait Implementations§

§

impl<F> Freeze for InRootSpan<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for InRootSpan<F>
where F: RefUnwindSafe,

§

impl<F> Send for InRootSpan<F>
where F: Send,

§

impl<F> Sync for InRootSpan<F>
where F: Sync,

§

impl<F> UnwindSafe for InRootSpan<F>
where F: UnwindSafe,

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> FutureExt for T
where T: Future,

Source§

fn in_span(self, span: Span) -> InSpan<Self>

Binds a Span to the Future that continues to record until the future is dropped. Read more
Source§

fn enter_on_poll(self, name: impl Into<Cow<'static, str>>) -> EnterOnPoll<Self>

Starts a LocalSpan at every Future::poll(). If the future gets polled multiple times, it will create multiple short spans. Read more
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<F> IntoFuture for F
where F: Future,

Source§

type Output = <F as Future>::Output

The output that the future will produce on completion.
Source§

type IntoFuture = F

Which kind of future are we turning this into?
Source§

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Scope for T

Source§

fn with<F, R>(self, f: F) -> R
where Self: Sized, F: FnOnce(Self) -> R,

Scoped with ownership.
Source§

fn with_ref<F, R>(&self, f: F) -> R
where F: FnOnce(&Self) -> R,

Scoped with reference.
Source§

fn with_mut<F, R>(&mut self, f: F) -> R
where F: FnOnce(&mut Self) -> R,

Scoped with mutable reference.
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

Source§

impl<T> Value for T
where T: Send + Sync + 'static,