pub(crate) struct Inner {
id: Id,
subscriber: Dispatch,
}
Expand description
A handle representing the capacity to enter a span which is known to exist.
Unlike Span
, this type is only constructed for spans which have been
enabled by the current filter. This type is primarily used for implementing
span handles; users should typically not need to interact with it directly.
Fields§
§id: Id
The span’s ID, as provided by subscriber
.
subscriber: Dispatch
The subscriber that will receive events relating to this span.
This should be the same subscriber that provided this span with its
id
.
Implementations§
source§impl Inner
impl Inner
sourcefn follows_from(&self, from: &Id)
fn follows_from(&self, from: &Id)
Indicates that the span with the given ID has an indirect causal relationship with this span.
This relationship differs somewhat from the parent-child relationship: a span may have any number of prior spans, rather than a single one; and spans are not considered to be executing inside of the spans they follow from. This means that a span may close even if subsequent spans that follow from it are still open, and time spent inside of a subsequent span should not be included in the time its precedents were executing. This is used to model causal relationships such as when a single future spawns several related background tasks, et cetera.
If this span is disabled, this function will do nothing. Otherwise, it
returns Ok(())
if the other span was added as a precedent of this
span, or an error if this was not possible.