pub struct Source {
pub name: String,
pub url: Option<String>,
pub tier: SourceTier,
pub source_type: SourceType,
pub domain: Option<String>,
pub author: Option<String>,
pub date: Option<String>,
pub verified: bool,
pub quote: Option<String>,
pub stance: Stance,
pub credibility: f32,
}Expand description
A source for triangulation
Fields§
§name: StringSource identifier/name
url: Option<String>URL if available
tier: SourceTierSource tier
source_type: SourceTypeSource type
domain: Option<String>Domain/field
Author/organization
date: Option<String>Publication date
verified: boolWhether URL was verified accessible
quote: Option<String>Direct quote supporting claim
stance: StanceDoes this source support or contradict the claim?
credibility: f32Credibility assessment (0.0-1.0)
Implementations§
Source§impl Source
impl Source
pub fn new(name: impl Into<String>, tier: SourceTier) -> Self
pub fn with_url(self, url: impl Into<String>) -> Self
pub fn with_type(self, source_type: SourceType) -> Self
pub fn with_domain(self, domain: impl Into<String>) -> Self
pub fn with_quote(self, quote: impl Into<String>) -> Self
pub fn with_stance(self, stance: Stance) -> Self
pub fn verified(self) -> Self
Sourcepub fn effective_weight(&self) -> f32
pub fn effective_weight(&self) -> f32
Calculate effective weight
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