pub struct Score {Show 21 fields
pub accuracy: f32,
pub ended_at: OffsetDateTime,
pub passed: bool,
pub grade: Grade,
pub map_id: u32,
pub max_combo: u32,
pub map: Option<Beatmap>,
pub mapset: Option<BeatmapsetCompact>,
pub mode: GameMode,
pub mods: GameMods,
pub perfect: bool,
pub pp: Option<f32>,
pub rank_country: Option<u32>,
pub rank_global: Option<u32>,
pub replay: Option<bool>,
pub score: u32,
pub score_id: Option<u64>,
pub statistics: ScoreStatistics,
pub user: Option<UserCompact>,
pub user_id: u32,
pub weight: Option<ScoreWeight>,
}
Fields§
§accuracy: f32
§ended_at: OffsetDateTime
§passed: bool
§grade: Grade
§map_id: u32
§max_combo: u32
§map: Option<Beatmap>
§mapset: Option<BeatmapsetCompact>
§mode: GameMode
§mods: GameMods
§perfect: bool
§pp: Option<f32>
§rank_country: Option<u32>
§rank_global: Option<u32>
§replay: Option<bool>
§score: u32
§score_id: Option<u64>
§statistics: ScoreStatistics
§user: Option<UserCompact>
§user_id: u32
§weight: Option<ScoreWeight>
Implementations§
source§impl Score
impl Score
pub fn get_user<'o>(&self, osu: &'o Osu) -> GetUser<'o> ⓘ
sourcepub fn total_hits(&self) -> u32
pub fn total_hits(&self) -> u32
Count all hitobjects of the score i.e. for GameMode::Osu
the amount 300s, 100s, 50s, and misses.
Note: Includes tiny droplet (misses) for GameMode::Catch
sourcepub fn grade(&self, accuracy: Option<f32>) -> Grade
pub fn grade(&self, accuracy: Option<f32>) -> Grade
Calculate the grade of the score.
Should only be used in case the score was modified and the internal grade
field is no longer correct.
The accuracy is only required for GameMode::Mania
and GameMode::Catch
scores and is
calculated internally if not provided.
This method assumes the score to be a pass i.e. the amount of passed objects is equal to the beatmaps total amount of objects. Otherwise, it may produce an incorrect grade.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Score
impl<'de> Deserialize<'de> for Score
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Score> for Score
impl PartialEq<Score> for Score
impl Eq for Score
Auto Trait Implementations§
impl RefUnwindSafe for Score
impl Send for Score
impl Sync for Score
impl Unpin for Score
impl UnwindSafe for Score
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.