pub struct BabyriteConfig {
pub json_logging: bool,
pub features: FeatureConfig,
pub github: GitHubConfig,
}Expand description
Babyrite configuration.
Loaded from config.toml. All fields have default values, so existing
configuration files without the new sections will continue to work.
Fields§
§json_logging: boolIf enabled, logs are output in JSON format.
features: FeatureConfigFeature flags for enabling/disabling specific functionality.
github: GitHubConfigGitHub-related configuration.
Implementations§
Source§impl BabyriteConfig
impl BabyriteConfig
Sourcepub fn init() -> Result<(), BabyriteConfigError>
pub fn init() -> Result<(), BabyriteConfigError>
Initializes the global configuration.
Loads configuration from a file if CONFIG_FILE_PATH is set,
otherwise uses default values.
Sourcepub fn get() -> &'static BabyriteConfig
pub fn get() -> &'static BabyriteConfig
Returns a reference to the global configuration.
§Panics
Panics if BabyriteConfig::init has not been called.
Trait Implementations§
Source§impl Debug for BabyriteConfig
impl Debug for BabyriteConfig
Source§impl Default for BabyriteConfig
impl Default for BabyriteConfig
Source§fn default() -> BabyriteConfig
fn default() -> BabyriteConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BabyriteConfig
impl<'de> Deserialize<'de> for BabyriteConfig
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 BabyriteConfig
impl RefUnwindSafe for BabyriteConfig
impl Send for BabyriteConfig
impl Sync for BabyriteConfig
impl Unpin for BabyriteConfig
impl UnsafeUnpin for BabyriteConfig
impl UnwindSafe for BabyriteConfig
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