pub struct GoalTracker { /* private fields */ }Expand description
Pure state machine for goal tracking.
Implementations§
Source§impl GoalTracker
impl GoalTracker
Sourcepub fn from_snapshot(session_dir: PathBuf, snapshot: GoalOrchestration) -> Self
pub fn from_snapshot(session_dir: PathBuf, snapshot: GoalOrchestration) -> Self
Restore tracker state from a persisted snapshot.
Sourcepub fn snapshot_mut(&mut self) -> Option<&mut GoalOrchestration>
pub fn snapshot_mut(&mut self) -> Option<&mut GoalOrchestration>
Return a mutable reference to the current orchestration snapshot.
Sourcepub fn account_elapsed(&mut self)
pub fn account_elapsed(&mut self)
Flush elapsed wall-clock time into elapsed_ms.
Sourcepub fn rollback_classifier_attempt(&mut self)
pub fn rollback_classifier_attempt(&mut self)
Undo the most recent attempt-slot reservation.
Sourcepub fn claim_strategist_fire(
&mut self,
should_fire: impl Fn(u32, u32) -> bool,
) -> Option<u32>
pub fn claim_strategist_fire( &mut self, should_fire: impl Fn(u32, u32) -> bool, ) -> Option<u32>
Atomically evaluate the strategist trigger and claim a fire.
Sourcepub fn revoke_strategist_cap_bonus(&mut self)
pub fn revoke_strategist_cap_bonus(&mut self)
Revoke the cap bonus granted by Self::claim_strategist_fire.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GoalTracker
impl RefUnwindSafe for GoalTracker
impl Send for GoalTracker
impl Sync for GoalTracker
impl Unpin for GoalTracker
impl UnsafeUnpin for GoalTracker
impl UnwindSafe for GoalTracker
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