pub struct AppConfig;Expand description
Application Configuration
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn get<V: DeserializeOwned>(key: &str) -> Option<V>
pub fn get<V: DeserializeOwned>(key: &str) -> Option<V>
Get configuration value
key is the key of the configuration item, such as app.name.
Note: The type of the obtained value needs to be consistent with the type of the value in the configuration.
If they are inconsistent, it may cause conversion failure. When conversion fails, None will be returned.
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnwindSafe for AppConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more