pub struct ScanJobTracker { /* private fields */ }Expand description
Monotonic progress tracker used inside one worker process.
Implementations§
Source§impl ScanJobTracker
impl ScanJobTracker
Sourcepub fn new(run_id: impl Into<String>, policy: ExecutionPolicy) -> Self
pub fn new(run_id: impl Into<String>, policy: ExecutionPolicy) -> Self
Starts a tracker for one run at configuration validation.
Sourcepub fn with_clock(
run_id: impl Into<String>,
policy: ExecutionPolicy,
clock: Arc<dyn MonotonicClock>,
) -> Self
pub fn with_clock( run_id: impl Into<String>, policy: ExecutionPolicy, clock: Arc<dyn MonotonicClock>, ) -> Self
Starts a tracker with an injected monotonic clock for deterministic execution tests.
Sourcepub fn enter_phase(
&mut self,
phase: JobPhase,
) -> Result<(), ExecutionLimitExceeded>
pub fn enter_phase( &mut self, phase: JobPhase, ) -> Result<(), ExecutionLimitExceeded>
Changes phase after checking the active deadlines.
§Errors
Returns ExecutionLimitExceeded when wall time or no-progress time is exhausted.
Sourcepub fn progress(&mut self, amount: u64) -> Result<(), ExecutionLimitExceeded>
pub fn progress(&mut self, amount: u64) -> Result<(), ExecutionLimitExceeded>
Charges verified completed work using checked arithmetic.
§Errors
Returns ExecutionLimitExceeded on arithmetic overflow or an exhausted deadline.
Sourcepub fn check_time(&self) -> Result<(), ExecutionLimitExceeded>
pub fn check_time(&self) -> Result<(), ExecutionLimitExceeded>
Checks monotonic wall time and time since the last verified progress.
§Errors
Returns ExecutionLimitExceeded when either effective duration is exhausted.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ScanJobTracker
impl !UnwindSafe for ScanJobTracker
impl Freeze for ScanJobTracker
impl Send for ScanJobTracker
impl Sync for ScanJobTracker
impl Unpin for ScanJobTracker
impl UnsafeUnpin for ScanJobTracker
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