pub struct Source {
pub source_type: SourceType,
pub url: Option<String>,
pub path: Option<String>,
pub arxiv_id: Option<String>,
pub github_repo: Option<String>,
pub retrieved_at: DateTime<Utc>,
pub version: Option<String>,
}Expand description
Source information for a document.
Contains provenance data including URLs, timestamps, and version information for proper citation and retrieval tracking.
§Example
use reasonkit::{Source, SourceType};
use chrono::Utc;
let source = Source {
source_type: SourceType::Github,
url: Some("https://github.com/org/repo".to_string()),
path: None,
arxiv_id: None,
github_repo: Some("org/repo".to_string()),
retrieved_at: Utc::now(),
version: Some("v1.0.0".to_string()),
};Fields§
§source_type: SourceTypeType of source (determines how to interpret other fields)
url: Option<String>URL of the source document (if applicable)
path: Option<String>Local file path (for local sources)
arxiv_id: Option<String>arXiv paper ID (e.g., “2301.12345”)
github_repo: Option<String>GitHub repository identifier (e.g., “owner/repo”)
retrieved_at: DateTime<Utc>Timestamp when the document was retrieved
version: Option<String>Version or commit hash of the source
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
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
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more