pub struct Membership {
pub relation_id: Option<String>,
pub role_id: Option<String>,
pub direction: Option<String>,
pub mbid: String,
pub name: String,
pub credited_as: Option<String>,
pub side: Side,
pub kind: String,
pub attributes: Vec<String>,
pub began: Option<String>,
pub ended: Option<String>,
pub over: Option<bool>,
}Expand description
One spell in a band, as a source dates it.
A person can appear twice, and the second row is not a duplicate: Ozzy Osbourne was in Black Sabbath from 1968 to 1979 and again from 1997, and a list that folded the two into one span would claim he was there in 1985. MusicBrainz states them as two relations and they are kept as two rows.
Fields§
§relation_id: Option<String>MusicBrainz relationship row identifier, when exposed.
role_id: Option<String>Stable MusicBrainz relationship type identifier.
direction: Option<String>Direction exactly as returned by MusicBrainz.
mbid: StringThe other artist’s MusicBrainz identifier, which is what makes a later fetch about them an update rather than a second opinion.
name: StringThe other artist’s name, as the source spells it.
credited_as: Option<String>Exact spelling used for the related artist in this relationship.
side: SideWhich end of the relation that name is — see Side.
kind: StringHow the source names the relationship, in its own words: member of band, instrumental supporting musician.
Kept verbatim and shown verbatim, the same rule
KnownRelease::stated_type follows. The two are not the same fact — a
founding member and a guitarist hired for one tour are both on a record
and only one of them was in the band — and paraphrasing them into one
word would throw away the distinction MusicBrainz took the trouble to
draw.
attributes: Vec<String>What the source lists against the relationship.
Not “instruments”, although most of them are. Measured on a real
answer: Judas Priest’s line-up carries ["guitar family", "original"]
on one row, where original marks an original member and is not an
instrument at all. Calling this field instruments would put a lie in
a column header, so it carries the source’s own word and its own
values.
began: Option<String>When it started: a year, or a fuller date when the source has one.
ended: Option<String>When it stopped.
over: Option<bool>Whether the source says it is over.
The same distinction ArtistFacts::active draws, and it matters more
here: a membership with no end date may be a current one or one nobody
has filled in, and printing “1968–” for both tells the reader something
the source never said. Some(false) is “still in the band”.
Implementations§
Source§impl Membership
impl Membership
Sourcepub fn covers(&self, year: u32) -> Option<bool>
pub fn covers(&self, year: u32) -> Option<bool>
Whether this membership was running in a given year: Some(true),
Some(false), or None where the source’s dates cannot say.
The three-way answer is the point. A membership with no start date
places nobody, and one the source says has ended without saying
when places nobody either — the end is somewhere, and “somewhere”
cannot be compared with a year. Both come back None, so a caller has
to decide what to do about them rather than being handed a false that
looks like knowledge.
Sourcepub fn years(&self) -> String
pub fn years(&self) -> String
The years as a reader recognises them: 1968–1979, 1968– for a
current member, 1968 where the source only knows a start and does not
say whether it ended.
Never invents an end. A dash trailing into nothing is a claim that
the membership is still going, and it is one MusicBrainz makes with
ended: false rather than with a missing date.
Trait Implementations§
Source§impl Clone for Membership
impl Clone for Membership
Source§fn clone(&self) -> Membership
fn clone(&self) -> Membership
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more