pub struct Stats {
pub lines: usize,
pub tracks: usize,
pub markers: usize,
pub timed: usize,
pub first_time: Option<f64>,
pub last_time: Option<f64>,
}Expand description
Counts over a tracklist.
use trackparse::tracklist::parse_tracklist;
let stats = parse_tracklist("Tracklist:\n00:00 Intro\n02:10 Noisia - Stigma\nA - B").stats;
assert_eq!((stats.lines, stats.tracks, stats.markers, stats.timed), (4, 2, 1, 2));
assert_eq!(stats.first_time, Some(0.0));
assert_eq!(stats.last_time, Some(130.0));Fields§
§lines: usizeNumber of lines (entries).
tracks: usizeNumber of Track entries.
markers: usizeNumber of Marker entries.
timed: usizeNumber of entries with a time.
first_time: Option<f64>The time of the first timed entry, in seconds.
last_time: Option<f64>The time of the last timed entry, in seconds.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stats
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Stats
Available on crate feature
serde only.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
impl StructuralPartialEq for Stats
Auto Trait Implementations§
impl Forget for Stats
impl Freeze for Stats
impl Move for Stats
impl RefUnwindSafe for Stats
impl Send for Stats
impl Sync for Stats
impl Unpin for Stats
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more