Struct Stats

Source
pub struct Stats {
Show 19 fields pub files: usize, pub tracks: usize, pub releases: usize, pub compilations: usize, pub artists: usize, pub album_artists: usize, pub labels: usize, pub genres: usize, pub total_duration_ms: u64, pub total_bytes: u64, pub orphan_tracks: usize, pub by_codec: Vec<Bucket>, pub by_quality: Vec<Bucket>, pub by_sample_rate: Vec<Bucket>, pub by_decade: Vec<Bucket>, pub cover_ratio: f64, pub year_ratio: f64, pub genre_ratio: f64, pub mbid_ratio: f64,
}
Expand description

Snapshot of what the catalog contains, recomputed on each call.

Fields§

§files: usize

Audio files seen on disk, whether or not they could be attached to anything.

§tracks: usize

Local track placements held by the catalog, one per file.

§releases: usize

Albums, EPs and singles reconstructed from the tags.

§compilations: usize

Releases gathering several artists rather than one, and so excluded from a discography.

§artists: usize

Distinct artists, all roles taken together.

§album_artists: usize

Artists carrying at least one album.

§labels: usize

Distinct record labels credited across the releases.

§genres: usize

Distinct genres in use, after the tags have been normalized.

§total_duration_ms: u64

Cumulative playing time of the library, in milliseconds, saturating at u64::MAX.

§total_bytes: u64

Space the audio files take up on disk, in bytes, saturating at u64::MAX. Cover art is not counted.

§orphan_tracks: usize

Tracks with no identified album.

§by_codec: Vec<Bucket>

Files grouped by container format, the untagged ones landing under unknown.

§by_quality: Vec<Bucket>

Files grouped by perceived quality, following QualityTier.

§by_sample_rate: Vec<Bucket>

Files grouped by sampling frequency; files that declare none are left out.

§by_decade: Vec<Bucket>

Releases grouped by decade of publication, undated ones gathered under a separate label.

§cover_ratio: f64

Share of releases having cover art (embedded or in the folder).

This field and the three that follow are proportions between 0 and 1, not percentages; the display layer decides how to present them.

§year_ratio: f64

Share of tracks carrying a year.

§genre_ratio: f64

Share of tracks carrying at least one genre.

§mbid_ratio: f64

Share of tracks already identified by a MusicBrainz MBID.

Trait Implementations§

Source§

impl Clone for Stats

Source§

fn clone(&self) -> Stats

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Stats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Stats

Source§

fn default() -> Stats

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,