pub struct SnapshotService { /* private fields */ }
Expand description
Service for creating and managing snapshots
Implementations§
Source§impl SnapshotService
impl SnapshotService
Sourcepub fn take_snapshot(
&mut self,
algorithms: &[Box<dyn Sorter>],
step: usize,
) -> &RaceSnapshot
pub fn take_snapshot( &mut self, algorithms: &[Box<dyn Sorter>], step: usize, ) -> &RaceSnapshot
Take a snapshot of the current race state
Sourcepub fn get_snapshots(&self) -> &[RaceSnapshot]
pub fn get_snapshots(&self) -> &[RaceSnapshot]
Get all snapshots
Sourcepub fn get_latest_snapshot(&self) -> Option<&RaceSnapshot>
pub fn get_latest_snapshot(&self) -> Option<&RaceSnapshot>
Get the most recent snapshot
Sourcepub fn get_snapshot(&self, index: usize) -> Option<&RaceSnapshot>
pub fn get_snapshot(&self, index: usize) -> Option<&RaceSnapshot>
Get snapshot by index
Sourcepub fn set_max_snapshots(&mut self, max: usize)
pub fn set_max_snapshots(&mut self, max: usize)
Set maximum number of snapshots to keep
Sourcepub fn get_max_snapshots(&self) -> usize
pub fn get_max_snapshots(&self) -> usize
Get maximum number of snapshots
Trait Implementations§
Source§impl Debug for SnapshotService
impl Debug for SnapshotService
Source§impl Default for SnapshotService
impl Default for SnapshotService
Source§fn default() -> SnapshotService
fn default() -> SnapshotService
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SnapshotService
impl RefUnwindSafe for SnapshotService
impl Send for SnapshotService
impl Sync for SnapshotService
impl Unpin for SnapshotService
impl UnwindSafe for SnapshotService
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