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: StringAs the source spells it: “France”, “United Kingdom”.
key: StringNormalised, 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
impl Place
Sourcepub fn short_forms(&self) -> Vec<String>
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.