pub struct FetchiumConfig {
pub general: GeneralConfig,
pub search: SearchConfig,
pub fetch: FetchConfig,
pub cache: CacheConfig,
pub ai: AiConfig,
pub output: OutputConfig,
pub ranking: RankingConfig,
pub youtube: YouTubeConfig,
pub social: SocialConfig,
pub headless: HeadlessConfig,
pub proxy: ProxyConfig,
pub dataimpulse: DataImpulseConfig,
}Expand description
Top-level configuration.
Fields§
§general: GeneralConfig§search: SearchConfig§fetch: FetchConfig§cache: CacheConfig§ai: AiConfig§output: OutputConfig§ranking: RankingConfig§youtube: YouTubeConfig§headless: HeadlessConfig§proxy: ProxyConfig§dataimpulse: DataImpulseConfigImplementations§
Source§impl FetchiumConfig
impl FetchiumConfig
Sourcepub fn facebook_graph_token(&self) -> Option<String>
pub fn facebook_graph_token(&self) -> Option<String>
Returns the Facebook Graph API token from config or env var.
Checks FETCHIUM_FACEBOOK_TOKEN, then the config file value.
Source§impl FetchiumConfig
impl FetchiumConfig
Sourcepub fn data_dir(&self) -> PathBuf
pub fn data_dir(&self) -> PathBuf
Get the data directory, creating it if it doesn’t exist.
Resolution order:
- Explicit override in config (
general.data_dir) ~/.fetchium/(new canonical location)~/.fetchium/
Sourcepub fn load_from(path: Option<&Path>) -> Self
pub fn load_from(path: Option<&Path>) -> Self
Load config with an optional path override.
Config file resolution (when no explicit path is given):
~/.fetchium/config.toml(new canonical location)- Default values if file does not exist
Sourcepub fn detect_resource_tier() -> ResourceTier
pub fn detect_resource_tier() -> ResourceTier
Detect the resource tier based on system capabilities.
Sourcepub fn apply_env_overrides(&mut self)
pub fn apply_env_overrides(&mut self)
Apply environment variable overrides.
Reads FETCHIUM_* environment variables.
Examples:
FETCHIUM_SEARCH_DEFAULT_BUDGET=8000
FETCHIUM_CACHE_ENABLED=false
Sourcepub fn ensure_data_dir(&self) -> Result<PathBuf>
pub fn ensure_data_dir(&self) -> Result<PathBuf>
Ensure the data directory exists, creating it if necessary.
Sourcepub fn config_file_path() -> PathBuf
pub fn config_file_path() -> PathBuf
Get the path to the config file.
Returns the canonical Fetchium config path.
Trait Implementations§
Source§impl Clone for FetchiumConfig
impl Clone for FetchiumConfig
Source§impl Debug for FetchiumConfig
impl Debug for FetchiumConfig
Source§impl Default for FetchiumConfig
impl Default for FetchiumConfig
Source§impl<'de> Deserialize<'de> for FetchiumConfigwhere
FetchiumConfig: Default,
impl<'de> Deserialize<'de> for FetchiumConfigwhere
FetchiumConfig: Default,
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 FetchiumConfig
impl RefUnwindSafe for FetchiumConfig
impl Send for FetchiumConfig
impl Sync for FetchiumConfig
impl Unpin for FetchiumConfig
impl UnsafeUnpin for FetchiumConfig
impl UnwindSafe for FetchiumConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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