pub struct SourceRef {
pub kind: SourceKind,
pub uri: Option<String>,
pub title: Option<String>,
pub captured_at: Option<String>,
pub source_local_id: Option<String>,
}Expand description
Portable reference to source material.
Fields§
§kind: SourceKindSource category.
uri: Option<String>Optional stable URI for source material.
title: Option<String>Optional human-readable source title.
captured_at: Option<String>Optional stable text capture time, such as RFC 3339.
source_local_id: Option<String>Optional identifier meaningful within the source system.
Implementations§
Source§impl SourceRef
impl SourceRef
Sourcepub fn new(kind: SourceKind) -> Self
pub fn new(kind: SourceKind) -> Self
Creates a source reference with no optional metadata.
Sourcepub fn with_uri(self, uri: impl Into<String>) -> Result<Self>
pub fn with_uri(self, uri: impl Into<String>) -> Result<Self>
Returns this source reference with a validated URI.
Sourcepub fn with_title(self, title: impl Into<String>) -> Result<Self>
pub fn with_title(self, title: impl Into<String>) -> Result<Self>
Returns this source reference with a validated title.
Sourcepub fn with_captured_at(self, captured_at: impl Into<String>) -> Result<Self>
pub fn with_captured_at(self, captured_at: impl Into<String>) -> Result<Self>
Returns this source reference with a validated capture timestamp payload.
Sourcepub fn with_source_local_id(
self,
source_local_id: impl Into<String>,
) -> Result<Self>
pub fn with_source_local_id( self, source_local_id: impl Into<String>, ) -> Result<Self>
Returns this source reference with a validated source-local identifier.
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 Eq for SourceRef
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