pub struct TierClassifier { /* private fields */ }Expand description
Classifies URLs into source tiers
Implementations§
Source§impl TierClassifier
impl TierClassifier
Sourcepub fn classify(&self, url: &str) -> SourceQuality
pub fn classify(&self, url: &str) -> SourceQuality
Classify a URL’s source tier
Sourcepub fn classify_multiple(&self, urls: &[String]) -> Vec<(String, SourceQuality)>
pub fn classify_multiple(&self, urls: &[String]) -> Vec<(String, SourceQuality)>
Classify multiple URLs and return sorted by quality
Sourcepub fn meets_triangulation_requirement(
&self,
sources: &[SourceQuality],
min_sources: usize,
min_tier: SourceTier,
) -> (bool, String)
pub fn meets_triangulation_requirement( &self, sources: &[SourceQuality], min_sources: usize, min_tier: SourceTier, ) -> (bool, String)
Check if a set of sources meets the triangulation requirement
Sourcepub fn add_tier1_domain(&mut self, domain: &str)
pub fn add_tier1_domain(&mut self, domain: &str)
Add a custom Tier 1 domain
Sourcepub fn add_tier2_domain(&mut self, domain: &str)
pub fn add_tier2_domain(&mut self, domain: &str)
Add a custom Tier 2 domain
Sourcepub fn add_unreliable_domain(&mut self, domain: &str)
pub fn add_unreliable_domain(&mut self, domain: &str)
Add a custom unreliable domain
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TierClassifier
impl RefUnwindSafe for TierClassifier
impl Send for TierClassifier
impl Sync for TierClassifier
impl Unpin for TierClassifier
impl UnwindSafe for TierClassifier
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> 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