pub struct SourceRecord {
pub key: String,
pub source: String,
pub source_id: Option<String>,
pub fetched_at: u64,
pub confidence: Confidence,
pub facts: Facts,
}Expand description
One entity, as one source describes it.
The key is the entity’s EntityRef key rather than a catalog id, for the
reason annotations use the same scheme: ids are positions that a scan
renumbers, and a record may describe an entity the catalog does not hold
yet.
Fields§
§key: StringThe EntityRef key of the entity described.
source: StringWho says so: MUSICBRAINZ, or the name of a plugin.
source_id: Option<String>The identifier that source uses — an MBID — which is what turns a second fetch into an update rather than a duplicate.
fetched_at: u64When it was fetched, in seconds since the Unix epoch, so a value can be shown as old rather than silently trusted forever.
confidence: ConfidenceHow firmly this is attached to the entity.
facts: FactsWhat was said.
Implementations§
Source§impl SourceRecord
impl SourceRecord
Sourcepub fn musicbrainz_recording_identity(&self) -> Option<&str>
pub fn musicbrainz_recording_identity(&self) -> Option<&str>
Retained MusicBrainz recording identity when its two stored selectors agree. Legacy snapshots may carry only the source ID or only the recording fact; two contradictory present IDs establish neither as a reusable identity. This neither proves lookup completion nor decides confidence/review trust.
Sourcepub fn musicbrainz_lookup_alias(&self) -> Option<&str>
pub fn musicbrainz_lookup_alias(&self) -> Option<&str>
A valid exact-lookup selector confirmed by this canonical MusicBrainz claim. Legacy snapshots without query provenance establish no alias. Recording receipts must also retain a completed, consistent canonical recording.
Sourcepub fn matches_edition(&self, id: &str) -> bool
pub fn matches_edition(&self, id: &str) -> bool
Whether retained edition facts describe this exact local edition. MusicBrainz may additionally prove one queried alias of the canonical edition; manual and other sources keep their literal scope. Neither a group alias nor missing/malformed identifiers establishes an edition.
Sourcepub fn local_musicbrainz_id<'a>(&self, catalog: &'a Catalog) -> Option<&'a str>
pub fn local_musicbrainz_id<'a>(&self, catalog: &'a Catalog) -> Option<&'a str>
Local identifier in this claim’s MusicBrainz namespace, without deciding trust. Release editions and release groups must never be compared across namespaces.
Sourcepub fn musicbrainz_release_identity(
&self,
) -> Option<MusicBrainzReleaseIdentity<'_>>
pub fn musicbrainz_release_identity( &self, ) -> Option<MusicBrainzReleaseIdentity<'_>>
The retained MusicBrainz album identifier with its original namespace.
An edition fallback is identified by the same ID in source_id and
ReleaseFacts::edition_mbid, as stored by crate::musicbrainz::release.
Older snapshots without an edition ID retain their established group
interpretation. This classifies the stored claim; it neither establishes
trust nor invents a missing group identifier.
Trait Implementations§
Source§impl Clone for SourceRecord
impl Clone for SourceRecord
Source§fn clone(&self) -> SourceRecord
fn clone(&self) -> SourceRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more