pub struct RaceResult {
pub array_size: u32,
pub distribution: DistributionType,
pub fairness_mode: FairnessMode,
pub completion_times: Vec<Option<Duration>>,
pub memory_usage: Vec<usize>,
pub algorithm_names: Vec<String>,
pub winner: Option<AlgorithmType>,
pub race_start: Instant,
pub race_end: Option<Instant>,
pub total_duration: Option<Duration>,
}
Expand description
Result of a single sorting race
Fields§
§array_size: u32
Array size used for this race
distribution: DistributionType
Distribution type used
fairness_mode: FairnessMode
Fairness mode used
completion_times: Vec<Option<Duration>>
Completion times for each algorithm (None if didn’t complete)
memory_usage: Vec<usize>
Memory usage for each algorithm
algorithm_names: Vec<String>
Algorithm type names for reference
winner: Option<AlgorithmType>
Winner algorithm (first to complete)
race_start: Instant
Race start timestamp
race_end: Option<Instant>
Race end timestamp
total_duration: Option<Duration>
Total race duration
Implementations§
Source§impl RaceResult
impl RaceResult
Sourcepub fn new(
array_size: u32,
distribution: DistributionType,
fairness_mode: FairnessMode,
algorithm_count: usize,
) -> Self
pub fn new( array_size: u32, distribution: DistributionType, fairness_mode: FairnessMode, algorithm_count: usize, ) -> Self
Create a new race result
Sourcepub fn set_completion_time(
&mut self,
algorithm_index: usize,
duration: Duration,
)
pub fn set_completion_time( &mut self, algorithm_index: usize, duration: Duration, )
Set completion time for an algorithm
Sourcepub fn set_memory_usage(&mut self, algorithm_index: usize, memory: usize)
pub fn set_memory_usage(&mut self, algorithm_index: usize, memory: usize)
Set memory usage for an algorithm
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if race is complete
Trait Implementations§
Source§impl Clone for RaceResult
impl Clone for RaceResult
Source§fn clone(&self) -> RaceResult
fn clone(&self) -> RaceResult
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 moreAuto Trait Implementations§
impl Freeze for RaceResult
impl RefUnwindSafe for RaceResult
impl Send for RaceResult
impl Sync for RaceResult
impl Unpin for RaceResult
impl UnwindSafe for RaceResult
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> 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