Performance

Trait Performance 

Source
pub trait Performance {
    // Required method
    fn performance(&self, result: &ChallengeResult) -> u32;

    // Provided method
    fn stars(&self, result: &ChallengeResult) -> u32 { ... }
}

Required Methods§

Source

fn performance(&self, result: &ChallengeResult) -> u32

Returns the performance in percentage.

Provided Methods§

Source

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.

Implementors§