pub struct OfficialSourceManager { /* private fields */ }
Expand description
Official documentation source manager
Implementations§
Source§impl OfficialSourceManager
impl OfficialSourceManager
Sourcepub fn is_official_domain(&self, domain: &str) -> bool
pub fn is_official_domain(&self, domain: &str) -> bool
Check if a domain is official documentation
Sourcepub fn get_source_tier(&self, domain: &str, url: &str) -> SourceTier
pub fn get_source_tier(&self, domain: &str, url: &str) -> SourceTier
Get source tier for a domain
Sourcepub fn build_official_query(&self, query: &str) -> String
pub fn build_official_query(&self, query: &str) -> String
Build DuckDuckGo query targeting official sources
Sourcepub fn get_score_boost(&self, tier: &SourceTier) -> f32
pub fn get_score_boost(&self, tier: &SourceTier) -> f32
Calculate score boost based on source tier
Sourcepub fn get_tier_description(&self, tier: &SourceTier) -> &'static str
pub fn get_tier_description(&self, tier: &SourceTier) -> &'static str
Get human-readable tier description
Sourcepub fn add_official_domain(&mut self, domain: String, tier: SourceTier)
pub fn add_official_domain(&mut self, domain: String, tier: SourceTier)
Add custom official domain (for user configuration)
Sourcepub fn get_official_domains(&self) -> &HashMap<String, SourceTier>
pub fn get_official_domains(&self) -> &HashMap<String, SourceTier>
Get all official domains for debugging/config display
Trait Implementations§
Source§impl Debug for OfficialSourceManager
impl Debug for OfficialSourceManager
Auto Trait Implementations§
impl Freeze for OfficialSourceManager
impl RefUnwindSafe for OfficialSourceManager
impl Send for OfficialSourceManager
impl Sync for OfficialSourceManager
impl Unpin for OfficialSourceManager
impl UnwindSafe for OfficialSourceManager
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