pub struct TaskSpine {
pub parent_id: Option<String>,
pub trace_id: String,
}Expand description
Maintains task-envelope lineage for the current execution thread.
Fields§
§parent_id: Option<String>Root task of the current session, absent when creating that root task.
trace_id: StringStable trace id shared by the root task and every true child in the session.
Implementations§
Source§impl TaskSpine
impl TaskSpine
pub fn create_envelope( query: &str, session_id: &str, agent_id: &str, ) -> TaskEnvelopeV1
pub fn enrich_from_triage( envelope: &mut TaskEnvelopeV1, profile: &TaskProfileLocal, )
pub fn task_id() -> Option<String>
pub fn current() -> Option<TaskEnvelopeV1>
Sourcepub fn scoped_current() -> Option<TaskEnvelopeV1>
pub fn scoped_current() -> Option<TaskEnvelopeV1>
Only an explicitly bound lifecycle may supply canonical execution identity.
Sourcepub fn set(envelope: TaskEnvelopeV1)
pub fn set(envelope: TaskEnvelopeV1)
Legacy synchronous callers may set a fallback, never overwrite a bound task.
Sourcepub fn sync_scope<T>(
envelope: Option<TaskEnvelopeV1>,
operation: impl FnOnce() -> T,
) -> T
pub fn sync_scope<T>( envelope: Option<TaskEnvelopeV1>, operation: impl FnOnce() -> T, ) -> T
Callers must capture the owning async scope before spawning a blocking job.
Sourcepub fn spawn_thread<T: Send + 'static>(
operation: impl FnOnce() -> T + Send + 'static,
) -> JoinHandle<T>
pub fn spawn_thread<T: Send + 'static>( operation: impl FnOnce() -> T + Send + 'static, ) -> JoinHandle<T>
Preserve the owner of a detached read/telemetry worker, including no owner.
Trait Implementations§
Auto Trait Implementations§
impl Forget for TaskSpine
impl Freeze for TaskSpine
impl Move for TaskSpine
impl RefUnwindSafe for TaskSpine
impl Send for TaskSpine
impl Sync for TaskSpine
impl Unpin for TaskSpine
impl UnsafeUnpin for TaskSpine
impl UnwindSafe for TaskSpine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 more