pub struct ConfigFile {
pub api_keys: ApiKeysConfig,
pub downloads: DownloadsConfig,
pub rate_limits: RateLimitsConfig,
pub sources: SourcesConfig,
pub source_rates: Vec<SourceRateConfig>,
pub cache: CacheConfig,
pub proxy: ProxyConfig,
pub logging: LoggingConfig,
}Expand description
Configuration file structure
Fields§
§api_keys: ApiKeysConfigAPI keys section
downloads: DownloadsConfigDownloads section
rate_limits: RateLimitsConfigRate limits section
sources: SourcesConfigSources section
source_rates: Vec<SourceRateConfig>Per-source rate limits
cache: CacheConfigCache section
proxy: ProxyConfigProxy section
logging: LoggingConfigLogging section
Implementations§
Source§impl ConfigFile
impl ConfigFile
Sourcepub fn load(path: &PathBuf) -> Result<Self, ConfigFileError>
pub fn load(path: &PathBuf) -> Result<Self, ConfigFileError>
Load configuration from a TOML file
Sourcepub fn save(&self, path: &PathBuf) -> Result<(), ConfigFileError>
pub fn save(&self, path: &PathBuf) -> Result<(), ConfigFileError>
Save configuration to a TOML file
Sourcepub fn create_default() -> Self
pub fn create_default() -> Self
Create default configuration
Trait Implementations§
Source§impl Debug for ConfigFile
impl Debug for ConfigFile
Source§impl Default for ConfigFile
impl Default for ConfigFile
Source§fn default() -> ConfigFile
fn default() -> ConfigFile
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ConfigFile
impl<'de> Deserialize<'de> for ConfigFile
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 ConfigFile
impl RefUnwindSafe for ConfigFile
impl Send for ConfigFile
impl Sync for ConfigFile
impl Unpin for ConfigFile
impl UnwindSafe for ConfigFile
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