pub struct CompletionState { /* private fields */ }Expand description
Completion state - Single Source of Truth for completion tracking
Implementations§
Source§impl CompletionState
impl CompletionState
Sourcepub fn record_worker_done(
&mut self,
worker_id: WorkerId,
success: bool,
message: Option<String>,
tick: u64,
)
pub fn record_worker_done( &mut self, worker_id: WorkerId, success: bool, message: Option<String>, tick: u64, )
Record a worker’s completion
Sourcepub fn mark_exploration_done(&mut self, exhausted: bool)
pub fn mark_exploration_done(&mut self, exhausted: bool)
Mark exploration as done
Sourcepub fn set_verdict(&mut self, verdict: TerminationVerdict)
pub fn set_verdict(&mut self, verdict: TerminationVerdict)
Set the final verdict
Sourcepub fn verdict(&self) -> Option<&TerminationVerdict>
pub fn verdict(&self) -> Option<&TerminationVerdict>
Get the final verdict if determined
Sourcepub fn is_environment_done(&self) -> bool
pub fn is_environment_done(&self) -> bool
Check if environment is done (any worker completed successfully)
Sourcepub fn is_exploration_done(&self) -> bool
pub fn is_exploration_done(&self) -> bool
Check if exploration is done
Sourcepub fn is_exploration_exhausted(&self) -> bool
pub fn is_exploration_exhausted(&self) -> bool
Check if exploration was exhausted (not explicitly completed)
Sourcepub fn has_verdict(&self) -> bool
pub fn has_verdict(&self) -> bool
Check if a verdict has been determined
Sourcepub fn completed_workers(&self) -> &HashMap<WorkerId, WorkerResult>
pub fn completed_workers(&self) -> &HashMap<WorkerId, WorkerResult>
Get all completed workers
Sourcepub fn any_worker_succeeded(&self) -> bool
pub fn any_worker_succeeded(&self) -> bool
Check if any worker completed successfully
Sourcepub fn all_completed_workers_succeeded(&self) -> bool
pub fn all_completed_workers_succeeded(&self) -> bool
Check if all workers that completed were successful
Sourcepub fn completion_tick(&self) -> Option<u64>
pub fn completion_tick(&self) -> Option<u64>
Get the tick when completion was first detected
Sourcepub fn first_success(&self) -> Option<(&WorkerId, &WorkerResult)>
pub fn first_success(&self) -> Option<(&WorkerId, &WorkerResult)>
Get the first successful worker result
Trait Implementations§
Source§impl Clone for CompletionState
impl Clone for CompletionState
Source§fn clone(&self) -> CompletionState
fn clone(&self) -> CompletionState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompletionState
impl Debug for CompletionState
Source§impl Default for CompletionState
impl Default for CompletionState
Source§fn default() -> CompletionState
fn default() -> CompletionState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CompletionState
impl RefUnwindSafe for CompletionState
impl Send for CompletionState
impl Sync for CompletionState
impl Unpin for CompletionState
impl UnwindSafe for CompletionState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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