[][src]Struct osu_db::replay::Replay

pub struct Replay {
    pub mode: Mode,
    pub version: u32,
    pub beatmap_hash: Option<String>,
    pub player_name: Option<String>,
    pub replay_hash: Option<String>,
    pub count_300: u16,
    pub count_100: u16,
    pub count_50: u16,
    pub count_geki: u16,
    pub count_katsu: u16,
    pub count_miss: u16,
    pub score: u32,
    pub max_combo: u16,
    pub perfect_combo: bool,
    pub mods: ModSet,
    pub life_graph: Option<String>,
    pub timestamp: DateTime<Utc>,
    pub replay_data: Option<Vec<Action>>,
    pub raw_replay_data: Option<Vec<u8>>,
    pub online_score_id: u64,
}

An osu! replay. The replay might come from a large ScoreList score database, or from an individual standalone .osr file.

Fields

mode: Mode

The gamemode the replay was scored in.

version: u32

The .db version of the replay file. If the replay is inside a scores.db file, the version should be redundant with it (?).

beatmap_hash: Option<String>

The MD5 hash of the beatmap played.

player_name: Option<String>

The name of the player who scored the replay.

replay_hash: Option<String>

The replay-specific MD5 hash.

count_300: u16

The same in all modes: amount of 300 scores.

count_100: u16

Amount of 100 scores in std and ctb, but 150 in taiko and 200 in mania.

count_50: u16

Amount of 50 scores in std and mania, but small fruit in ctb.

count_geki: u16

Amount of gekis in std, but MAX scores (rainbow 300s) in mania.

count_katsu: u16

Amount of katsus in std, but 100 scores in mania.

count_miss: u16

Amount of misses in all modes.

score: u32

The numerical score achieved.

max_combo: u16perfect_combo: boolmods: ModSet

The mod combination with which the replay was done.

life_graph: Option<String>

A string representing a graph of how much life bar did the player have along the beatmap.

It is a comma-separated list of human-readable entries in the form <offset>|<life>, where <offset> is the amount of milliseconds since the start of the song and <life> is a number between 0 and 1 representing the amount of life left.

timestamp: DateTime<Utc>

When was the replay scored.

replay_data: Option<Vec<Action>>

Decompressed replay data.

Only available on standalone .osr replays, and if the compression feature is enabled (enabled by default).

When writing .osr files (and .osr files only), if the compression feature is enabled and this field is Some, these actions will be compressed and written. Otherwise, raw_replay_data will be written instead.

raw_replay_data: Option<Vec<u8>>

Raw replay data, available on .osr files even if the compression feature is not enabled.

When writing, this field is used as a fallback if replay_data is None or the compression feature is disabled.

online_score_id: u64

Online score id. Only has a useful value on replays embedded in a ScoreList.

Implementations

impl Replay[src]

pub fn from_bytes(bytes: &[u8]) -> Result<Replay, Error>[src]

Parse a replay from its raw bytes.

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Replay, Error>[src]

Read a replay from a standalone .osr osu! replay file.

pub fn to_writer<W: Write>(
    &self,
    out: W,
    compression_level: Option<u32>
) -> Result<()>
[src]

Write the replay to an arbitrary writer, with the given compression level.

If the compression level is None the arbitrary default replay::DEFAULT_COMPRESSION_LEVEL will be used. If the compression feature is disabled this argument has no effect.

pub fn save<P: AsRef<Path>>(
    &self,
    path: P,
    compression_level: Option<u32>
) -> Result<()>
[src]

Similar to to_writer but writes the replay to an osr file.

Trait Implementations

impl Clone for Replay[src]

impl Debug for Replay[src]

impl PartialEq<Replay> for Replay[src]

impl StructuralPartialEq for Replay[src]

Auto Trait Implementations

impl RefUnwindSafe for Replay

impl Send for Replay

impl Sync for Replay

impl Unpin for Replay

impl UnwindSafe for Replay

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.