1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use ;
/// Contextual information available to a running job instance via task-locals.
/// Accessible within a `BoxedExecFn` using `try_get_current_job_context()`
/// or the `job_context!()` macro when the `job_context` feature is enabled.
task_local!
/// Attempts to retrieve the current `JobContext` for the executing job.
///
/// Requires the `job_context` feature to be enabled.
///
/// Returns `Some(JobContext)` if the job is running within the context set by
/// the TurnKeeper worker, `None` otherwise.
/// Retrieves the current `JobContext`, panicking if called outside a
/// TurnKeeper-managed job task where the context has not been set.
///
/// Requires the `job_context` feature to be enabled.
/// Use `try_get_current_job_context()` for safe, optional access.
///
/// # Panics
/// Panics if the `CURRENT_JOB_CONTEXT` task local has not been set.
// Needs to be exported from the crate root effectively