pub struct AppAllConfig {
pub toml_value: Value,
}Expand description
全局配置文件
Fields§
§toml_value: ValueImplementations§
Source§impl AppAllConfig
impl AppAllConfig
Sourcepub fn get<T: DeserializeOwned>(&self, key: &str) -> Option<T>
pub fn get<T: DeserializeOwned>(&self, key: &str) -> Option<T>
获取配置值并反序列化
Sourcepub fn get_or_default<T: DeserializeOwned>(&self, key: &str, default: T) -> T
pub fn get_or_default<T: DeserializeOwned>(&self, key: &str, default: T) -> T
获取配置值或默认值
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppAllConfig
impl RefUnwindSafe for AppAllConfig
impl Send for AppAllConfig
impl Sync for AppAllConfig
impl Unpin for AppAllConfig
impl UnsafeUnpin for AppAllConfig
impl UnwindSafe for AppAllConfig
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