pub struct BabyriteConfig {
pub json_logging: bool,
}Expand description
Babyrite configuration.
All configuration default values are false.
Fields§
§json_logging: boolIf enabled, logs are output in JSON format.
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 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