Struct firefly_types::Stats
source · pub struct Stats {
pub minutes: [u32; 4],
pub longest_play: [u32; 4],
pub launches: [u32; 4],
pub installed_on: (u16, u8, u8),
pub launched_on: (u16, u8, u8),
}Expand description
Player-specific app stats, like playtime.
Fields§
§minutes: [u32; 4]How many minutes the app was played for every player count from 1 to 4+.
Games with more than 4 players are recorded as 4 players. So, the last index (3) is “4+ players”.
The play time is calculated based on the number of the calls
to the update callback. So, the number is an approximation
and may drift a bit.
Plays shorter than 1 minute are not recorded.
longest_play: [u32; 4]How many minutes the app was played the longest for every player count from 1 to 4+.
Use this metric carefully. The runtime might or might not account for players pausing the app for days instead of exiting it. Which means, multiple play sessions may be counted as one.
launches: [u32; 4]How many times the app was launched for every player count from 1 to 4+.
installed_on: (u16, u8, u8)The date when the app was installed.
The date is a tuple of year, month, and day of month.
launched_on: (u16, u8, u8)The date when the app was launched last time.
The date is a tuple of year, month, and day of month.
Implementations§
source§impl Stats
impl Stats
sourcepub fn decode(s: &[u8]) -> Result<Self, Error>
pub fn decode(s: &[u8]) -> Result<Self, Error>
Load stats from bytes generated by Stats::encode.
§Errors
May return an error if the buffer does not contain valid stats.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Stats
impl<'de> Deserialize<'de> for Stats
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>,
source§impl PartialEq for Stats
impl PartialEq for Stats
impl StructuralPartialEq for Stats
Auto Trait Implementations§
impl Freeze for Stats
impl RefUnwindSafe for Stats
impl Send for Stats
impl Sync for Stats
impl Unpin for Stats
impl UnwindSafe for Stats
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)