pub struct SourceRef {
pub id: SourceId,
pub locator: String,
pub title: Option<String>,
pub media_type: Option<String>,
pub issuer: Option<String>,
pub published_at: Option<Timestamp>,
pub retrieved_at: Option<Timestamp>,
pub content_hash: Option<ContentHash>,
pub authority: SourceAuthority,
pub derivation: Derivation,
pub submitted_by: Option<Attribution>,
pub visibility: Visibility,
}Expand description
A reference to a source artifact with provenance metadata.
Fields§
§id: SourceId§locator: StringURI of the artifact (https://..., urn:..., doi:...).
title: Option<String>§media_type: Option<String>§issuer: Option<String>The institution or person that issued the artifact, if known.
published_at: Option<Timestamp>Publication time claimed by or for the source, if known.
retrieved_at: Option<Timestamp>When the artifact was retrieved/consulted (distinct from publication).
content_hash: Option<ContentHash>Hash of the retrieved bytes, if they were fetched. See ContentHash.
derivation: Derivation§submitted_by: Option<Attribution>Who attached this reference.
visibility: VisibilityA source can be more restricted than the record that cites it (for example a private attachment on a public issue).
Implementations§
Source§impl SourceRef
impl SourceRef
pub fn new(locator: impl Into<String>) -> Self
pub fn title(self, t: impl Into<String>) -> Self
pub fn issuer(self, i: impl Into<String>) -> Self
pub fn retrieved_at(self, t: Timestamp) -> Self
pub fn published_at(self, t: Timestamp) -> Self
pub fn submitted_by(self, a: Attribution) -> Self
pub fn visibility(self, v: Visibility) -> Self
pub fn derivation(self, d: Derivation) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SourceRef
impl<'de> Deserialize<'de> for SourceRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for SourceRef
Auto Trait Implementations§
impl Freeze for SourceRef
impl RefUnwindSafe for SourceRef
impl Send for SourceRef
impl Sync for SourceRef
impl Unpin for SourceRef
impl UnsafeUnpin for SourceRef
impl UnwindSafe for SourceRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more