pub struct FiberContext {
pub phase: Arc<str>,
pub cycle: AtomicU64,
pub controls: ControlMap,
}Expand description
Per-fiber execution context carried across the async call
chain via a tokio::task_local! binding. Thread-locals are
unsafe here because tokio’s work-stealing scheduler can
migrate a task between worker threads at any .await; a
task-local is bound to the task itself and survives
migration.
Fields§
§phase: Arc<str>Name of the phase this fiber is running under. Arc’d so two fibers under the same phase share one allocation.
cycle: AtomicU64Current cycle ordinal. AtomicU64 rather than Cell so
the context is Sync — tokio requires task-local values
to be Send + Sync.
controls: ControlMapSRD-89 — the current component’s control resolution, for this
fiber’s execution: control name → live erased handle, walked up once
from the fiber’s own phase component
(nmbrs_metrics::component::Component::control_snapshot, first-match /
nearest-wins) and read lock-free thereafter. It holds live handles, not
values, so a servo retarget on the shared control is observed through it.
Because each execution’s fibers carry their own phase component’s
snapshot, a same-named control (concurrency / rate) resolves to that
execution’s instance — uniformly in single-run and concurrent runs, with
no session-root walk and no cross-talk. Empty for fibers spawned without
a component (a control read then falls back to the session-root walk).
Auto Trait Implementations§
impl !Freeze for FiberContext
impl !RefUnwindSafe for FiberContext
impl !UnwindSafe for FiberContext
impl Send for FiberContext
impl Sync for FiberContext
impl Unpin for FiberContext
impl UnsafeUnpin for FiberContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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