Struct Place

Source
pub struct Place {
    pub name: String,
    pub key: String,
    pub code: Option<String>,
    pub initials: Option<String>,
    pub artists: Vec<Id>,
}
Expand description

One country, and who on the shelf is from it.

Fields§

§name: String

As the source spells it: “France”, “United Kingdom”.

§key: String

Normalised, for matching. See text::normalize.

§code: Option<String>

The ISO code, lowercased, when any record carries one.

Absent for a place whose artists were all fetched before the code was kept, and absent for a place MusicBrainz gave no code for. This is the only thing here that an authority assigned, which is why it has a column of its own: Place::initials beside it in one column made US — the initials of “United States” — read as an ISO code, and made a country with no code look like a country with no short form.

§initials: Option<String>

The initials of a multi-word name, when they name this place alone.

Computed by countries over the whole set rather than from the name on its own, because whether a short form is usable is a property of the set: keep_usable_initials says what disqualifies one.

§artists: Vec<Id>

The artists from there, in catalog order.

Implementations§

Source§

impl Place

Source

pub fn short_forms(&self) -> Vec<String>

Every short form a reader may type for this place. Empty when the name is the only way in.

The code first: it is the one an authority assigns. There is no guard here against the two being the same word — US is both the code and the initials of “United States” — because keep_usable_initials has already dropped initials that repeat their own place’s code. Deduplicating at the point of display would have meant deduplicating at every point of display, and one of them was going to be forgotten: the table, which shows the two in separate columns, duly printed US twice.

Trait Implementations§

Source§

impl Clone for Place

Source§

fn clone(&self) -> Place

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 Place

Source§

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

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

impl PartialEq for Place

Source§

fn eq(&self, other: &Place) -> 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 Place

Source§

impl StructuralPartialEq for Place

Auto Trait Implementations§

§

impl Freeze for Place

§

impl RefUnwindSafe for Place

§

impl Send for Place

§

impl Sync for Place

§

impl Unpin for Place

§

impl UnwindSafe for Place

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