pub struct Replay {Show 20 fields
pub mode: Mode,
pub version: u32,
pub beatmap_hash: String,
pub player_username: String,
pub replay_hash: String,
pub count_300: u16,
pub count_100: u16,
pub count_50: u16,
pub count_geki: u16,
pub count_katu: u16,
pub count_miss: u16,
pub score: u32,
pub max_combo: u16,
pub perfect: bool,
pub mods: Mods,
pub life_graph: Vec<(i32, f64)>,
pub timestamp: u64,
pub action_data: Vec<u8>,
pub score_id: Option<u64>,
pub target_practice_total_accuracy: Option<f64>,
}
Expand description
A replay object.
See the module documentation for examples of using this struct.
Fields
mode: Mode
osu! game mode that this replay was recorded for
Note the mode field may change the meaning of some of the count_*
fields
becuase some osu! modes score slightly differently from standard
version: u32
osu! game version this replay was recorded on
beatmap_hash: String
MD5 hash for the beatmap this replay’s map
player_username: String
The username of player
replay_hash: String
MD5 hash for this replay
count_300: u16
The number of 300s the player scored in this map
count_100: u16
The number of 100s the player scored, or 150s in taiko
count_50: u16
The number of 50s the player scored, or small fruit in Catch the Beat
count_geki: u16
The number of gekis the player scored in standard, or max 300s in Mania
count_katu: u16
The number of katus the player scored in standard, or 200s in Mania
count_miss: u16
The number of misses
score: u32
total score as displayed on the score report
max_combo: u16
max combo as displayed on the score report
perfect: bool
true if the player has no misses, slider breaks, or early finished sliders.
mods: Mods
mod values mods or’d together
life_graph: Vec<(i32, f64)>
List of integer timestamps with an associated player life value.
0 = No health, 1 = Full health
timestamp: u64
Timestamp of the replay in measured in 1/10ths of a millisecond (100 ns)
This is value is measured in windows ticks It counts the number of ticks from 12:00:00 midnight, January 1, 0001 to the time this replay was created
action_data: Vec<u8>
The action data contained in this replay.
If the feature replay-data
is enabled, the function parse_action_data
can be used to
decompress and parse the data that is contained in this replay.
score_id: Option<u64>
Online ID of this score, if submitted.
target_practice_total_accuracy: Option<f64>
Only present if self.mods
includes Target Practice (bit 23)
Total accuracy of all hits.
Divide this value by the number of targets to find the actual accuracy
Implementations
sourceimpl Replay
impl Replay
sourcepub fn parse<R: Read>(reader: &mut R) -> ReplayResult<Replay>
pub fn parse<R: Read>(reader: &mut R) -> ReplayResult<Replay>
Parse the replay header from a replay file.
The returned struct will be missing the action
, score_id
, and target_practice_total_accuracy
fields.
If you need score_id
or target_practice_total_accuracy
, but don’t want to parse actions use the parse_skip_actions
function instead.
sourcepub fn write<W: Write>(&self, w: W) -> ReplayResult<()>
pub fn write<W: Write>(&self, w: W) -> ReplayResult<()>
Writes this replay to the given writer
sourcepub fn update_action_data(
&mut self,
action_data: &ReplayActionData
) -> ReplayResult<()>
Available on crate feature replay-data
only.
pub fn update_action_data(
&mut self,
action_data: &ReplayActionData
) -> ReplayResult<()>
replay-data
only.Updates the Replay object with action data
sourcepub fn parse_action_data(&self) -> ReplayResult<ReplayActionData>
Available on crate feature replay-data
only.
pub fn parse_action_data(&self) -> ReplayResult<ReplayActionData>
replay-data
only.Parse and retrieve the actions in the replay
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Replay
impl<'de> Deserialize<'de> for Replay
sourcefn 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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more