#[non_exhaustive]pub struct JobContext<'a> {
pub last_run: Option<JobRunRecord>,
pub cancel: CancellationToken,
pub host: Option<&'a dyn JobHost>,
pub _marker: PhantomData<&'a ()>,
}Expand description
Per-run context.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.last_run: Option<JobRunRecord>Information about the previous run, if any.
cancel: CancellationTokenCooperative-cancel token — implementations check between work units to honor reload / shutdown.
host: Option<&'a dyn JobHost>Optional host services pointer. None in pure unit tests; the
scheduler driver populates it with a concrete dyn JobHost
(typically uni-db::scheduler::SchedulerJobHost).
_marker: PhantomData<&'a ()>Lifetime marker for session / config refs added later.
Implementations§
Source§impl<'a> JobContext<'a>
impl<'a> JobContext<'a>
Sourcepub fn new(cancel: CancellationToken, last_run: Option<JobRunRecord>) -> Self
pub fn new(cancel: CancellationToken, last_run: Option<JobRunRecord>) -> Self
Construct a fresh per-run context from a cancellation token and the previous run’s record (if any).
Out-of-crate callers (e.g., the host scheduler driver in
uni-db::scheduler) use this constructor because
JobContext is #[non_exhaustive] and cannot be built with
a struct literal from outside this crate. Host services
(storage, inner-query, etc.) are attached via
Self::with_host.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for JobContext<'a>
impl<'a> !UnwindSafe for JobContext<'a>
impl<'a> Freeze for JobContext<'a>
impl<'a> Send for JobContext<'a>
impl<'a> Sync for JobContext<'a>
impl<'a> Unpin for JobContext<'a>
impl<'a> UnsafeUnpin for JobContext<'a>
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