Struct Sources

Source
pub struct Sources {
    pub records: Vec<SourceRecord>,
    pub reviews: Vec<SourceReview>,
    pub credit_exclusions: Vec<CreditExclusion>,
}
Expand description

Everything other sources have said, as it sits in sources.json.

Fields§

§records: Vec<SourceRecord>

One row per entity and source.

§reviews: Vec<SourceReview>

Explicit answers to claims that could not safely resolve themselves.

§credit_exclusions: Vec<CreditExclusion>

User decisions about individual source credits.

Implementations§

Source§

impl Sources

Source

pub fn get(&self, entity: &EntityRef, source: &str) -> Option<&SourceRecord>

What one source says about one entity, if it has said anything.

Source

pub fn about<'a>( &'a self, entity: &'a EntityRef, ) -> impl Iterator<Item = &'a SourceRecord>

Everything every source says about one entity.

Several rows are the point rather than a defect: two sources that disagree are two rows, and the disagreement is reported instead of being resolved behind the user’s back.

Source

pub fn review_for(&self, record: &SourceRecord) -> Option<&SourceReview>

The current decision for this exact source claim.

Source

pub fn is_trusted(&self, catalog: &Catalog, record: &SourceRecord) -> bool

Whether a source record is safe to use as a graph relationship.

A decision wins over the mechanical confidence. With no decision, only exact attachments that do not contradict a local MusicBrainz identity are trusted.

Source

pub fn contradicts_linked_identity( &self, catalog: &Catalog, record: &SourceRecord, ) -> bool

Whether a biography cache belongs to a different known provider identity.

Only a trusted MusicBrainz relationship can establish a contradiction. Missing relationships and pending proposals do not invalidate independent evidence. This is a cache identity check, not a review decision: explicit reviews of the biography itself still take priority in is_trusted.

Source

pub fn review_items(&self, catalog: &Catalog) -> Vec<ReviewItem>

Every current claim requiring or carrying an explicit review.

Source

pub fn decide( &mut self, catalog: &Catalog, selector: &str, decision: ReviewDecision, reviewed_at: u64, ) -> Result<ReviewItem, String>

Accepts or rejects one review item selected by its full ID or an unambiguous prefix. Returns the reviewed item as it now stands.

Source

pub fn clear_review( &mut self, catalog: &Catalog, selector: &str, ) -> Result<ReviewItem, String>

Removes one explicit decision, returning the item to pending state.

Source

pub fn set_review(&mut self, review: SourceReview) -> bool

Stores one review, replacing the previous decision about the same exact claim.

Source

pub fn set(&mut self, record: SourceRecord) -> bool

Files a record, replacing whatever that same source said before.

Returns true when it replaced an existing row. A second fetch is an update, not a duplicate — but only for the same source: what MusicBrainz says never overwrites what a plugin said, which is the whole reason the source is part of the key.

Source-asserted recording-to-work links that this catalog can place.

The source record is keyed by a local track path, while the graph’s relationship belongs to the canonical recording carrying that track. Resolving this only when read keeps rescans and source updates independent. Conflicting sources are intentionally all returned.

Explicit part-of-work assertions, retaining the attachment’s trust.

Rich recording and work credits that can be placed on this catalog.

The relationship remains external evidence. Mapping the source record’s track to its canonical recording makes it traversable without copying the claim into the tag-built catalog.

Credits anchored to an exact fetched edition or an explicit local manual correction. A release-group-only answer cannot supply these.

Source

pub fn exclude_credit(&mut self, relation: RelationRef, at: u64)

Exclude one relationship without losing the underlying fetched claim.

Source

pub fn exclude_credit_in( &mut self, catalog: &Catalog, relation: RelationRef, at: u64, )

Exclude a current credit while retaining its artist’s exact identity. Keeping a known MBID makes the decision survive the artist entering or leaving local tags without changing displayed relationship selectors.

Source

pub fn restore_credit(&mut self, relation: &RelationRef) -> bool

Take back one exclusion and make the original claim eligible again.

Source

pub fn restore_credit_in( &mut self, catalog: &Catalog, relation: &RelationRef, ) -> bool

Restore a credit selected from the current catalog, including an older exclusion whose named endpoint now has an exact MusicBrainz identity.

Dated group memberships, retaining external endpoints when the related artist is not part of the local catalog.

Source

pub fn find_sourced_works( &self, catalog: &Catalog, query: &str, ) -> Vec<SourcedWork>

Certain source-backed works matching a title or MusicBrainz ID.

Approximate attachment records stay visible through Sources::work_links but do not become navigation targets. This is the boundary between evidence and a relationship safe enough to traverse.

Source

pub fn label_identity( &self, catalog: &Catalog, label_id: Id, ) -> Option<LabelIdentityResolution>

Reconciles one label’s explicit tag identity with its source record.

Source

pub fn label_identities(&self, catalog: &Catalog) -> Vec<SourcedLabelIdentity>

MusicBrainz label identities that this catalog can place.

Searches are deliberately absent: an equally named label is not an identity. The Identified confidence records are identifier lookups.

Source

pub fn forget(&mut self, source: &str) -> usize

Drops everything one source ever said, and reports how much that was.

The counterpart of an attributed layer: a value that can be traced to a source can also be removed by naming that source, without touching what anybody else said.

Source

pub fn forget_entity(&mut self, entity: &EntityRef) -> usize

Drops everything said about one entity, whoever said it.

Trait Implementations§

Source§

impl Clone for Sources

Source§

fn clone(&self) -> Sources

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 Sources

Source§

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

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

impl Default for Sources

Source§

fn default() -> Sources

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

impl PartialEq for Sources

Source§

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

Source§

impl StructuralPartialEq for Sources

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