pub struct YamlConfig {
pub cache: CacheConfig,
}Expand description
File-based config deserialized from config/<env>.yml. Only the cache
section is read; other sections (server, database, logger…) are ignored.
Fields§
§cache: CacheConfigImplementations§
Source§impl YamlConfig
impl YamlConfig
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Loads config/<env>.yml for the environment from Environment::get_env.
Sourcepub fn load_env(env: Environment) -> Result<Self>
pub fn load_env(env: Environment) -> Result<Self>
Loads config/<env>.yml for a specific environment.
Sourcepub fn from_yaml(yaml: &str) -> Result<Self>
pub fn from_yaml(yaml: &str) -> Result<Self>
Parses a YamlConfig from a YAML string.
Trait Implementations§
Source§impl Clone for YamlConfig
impl Clone for YamlConfig
Source§fn clone(&self) -> YamlConfig
fn clone(&self) -> YamlConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for YamlConfig
impl Debug for YamlConfig
Source§impl Default for YamlConfig
impl Default for YamlConfig
Source§fn default() -> YamlConfig
fn default() -> YamlConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for YamlConfig
impl<'de> Deserialize<'de> for YamlConfig
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 YamlConfig
impl RefUnwindSafe for YamlConfig
impl Send for YamlConfig
impl Sync for YamlConfig
impl Unpin for YamlConfig
impl UnsafeUnpin for YamlConfig
impl UnwindSafe for YamlConfig
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