pub struct Algorithm {
pub state: AlgorithmState,
pub steps_executed: usize,
pub runtime_ms: u64,
pub is_paused: bool,
}Expand description
Algorithm configuration and state tracking
Fields§
§state: AlgorithmStateCurrent execution state
steps_executed: usizeNumber of steps executed
runtime_ms: u64Total runtime in milliseconds
is_paused: boolWhether algorithm is paused
Implementations§
Source§impl Algorithm
impl Algorithm
Sourcepub fn increment_steps(&mut self)
pub fn increment_steps(&mut self)
Increment step counter
Sourcepub fn add_runtime(&mut self, ms: u64)
pub fn add_runtime(&mut self, ms: u64)
Add to runtime
Sourcepub fn toggle_pause(&mut self)
pub fn toggle_pause(&mut self)
Toggle pause state
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnwindSafe for Algorithm
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> 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