Struct KnownRelease

Source
pub struct KnownRelease {
    pub mbid: String,
    pub title: String,
    pub first_released: Option<String>,
    pub primary_type: Option<String>,
    pub secondary_types: Vec<String>,
}
Expand description

One record a source credits to an artist, whether or not you own it.

Enough to recognise it and to show it: the identifier that makes a second fetch an update, the title, when it first appeared, and what kind of record it is. Not a ReleaseFacts, which is what a source says about an album in the catalog — this is a name on a list, and the difference matters: one is attached to files, the other is precisely the one that is not.

Fields§

§mbid: String

Release-group identifier, which is what the catalog’s own release_group_mbid can be compared against without guessing.

§title: String

Title as the source spells it.

§first_released: Option<String>

When the album first appeared — the year a reader recognises it by.

§primary_type: Option<String>

Album, Single, EP, Broadcast, Other.

§secondary_types: Vec<String>

Compilation, Soundtrack, Live, Remix, Demo…

Implementations§

Source§

impl KnownRelease

Source

pub fn is_studio_album(&self) -> bool

true for a studio album: primary type Album, and nothing else.

The filter that makes a completeness report readable rather than a wall. A discography holds every single, every live recording, every compilation somebody assembled, and reporting all of them as missing would be true and useless — nobody’s shelf holds every single ever pressed, and a report that is mostly noise is a report nobody opens.

Applied here, on what came back, rather than trusted to the request: a server-side filter narrows what travels, but only this decides what is shown, so a parameter the service ignores costs bandwidth and not correctness.

Source

pub fn stated_type(&self) -> String

What the source calls this record, in the source’s own words.

For a report that has left something out to be able to say why. The words are MusicBrainz’s — Album · Live, Single, Album · Compilation — rather than a vocabulary of our own, because the reader’s next move is often to go and correct the type on the page where it is set, and a paraphrase would send them looking for a word that is not written there.

A record nobody has typed at all says so: it is not a studio album either, and having no type is exactly why it was left out.

Source

pub fn year(&self) -> Option<&str>

The year, for a date that may be a year, a month or a full date.

Trait Implementations§

Source§

impl Clone for KnownRelease

Source§

fn clone(&self) -> KnownRelease

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 KnownRelease

Source§

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

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

impl PartialEq for KnownRelease

Source§

fn eq(&self, other: &KnownRelease) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for KnownRelease

Source§

impl StructuralPartialEq for KnownRelease

Auto Trait Implementations§

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>,