pub trait Performance {
// Required method
fn performance(&self, result: &ChallengeResult) -> u32;
// Provided method
fn stars(&self, result: &ChallengeResult) -> u32 { ... }
}Required Methods§
Sourcefn performance(&self, result: &ChallengeResult) -> u32
fn performance(&self, result: &ChallengeResult) -> u32
Returns the performance in percentage.
Provided Methods§
Sourcefn stars(&self, result: &ChallengeResult) -> u32
fn stars(&self, result: &ChallengeResult) -> u32
Returns the number of stars based on the performance.
3 stars for 80% or more, 2 stars for 60% or more, 1 star for 40% or more, 0 stars otherwise.
The performance is calculated by the performance method.