pub struct ConfigLoader { /* private fields */ }Expand description
Configuration loader 配置加载器
Equivalent to Spring Boot’s ConfigFileApplicationListener.
等价于Spring Boot的ConfigFileApplicationListener。
Handles loading configuration from various sources with priority ordering. 处理从各种来源加载具有优先级顺序的配置。
Implementations§
Source§impl ConfigLoader
impl ConfigLoader
Sourcepub fn builder() -> ConfigLoaderBuilder
pub fn builder() -> ConfigLoaderBuilder
Create a loader builder 创建加载器构建器
Sourcepub fn add_search_path(self, path: impl Into<PathBuf>) -> Self
pub fn add_search_path(self, path: impl Into<PathBuf>) -> Self
Add a search path 添加搜索路径
Sourcepub fn add_file_name(self, name: impl Into<String>) -> Self
pub fn add_file_name(self, name: impl Into<String>) -> Self
Add a file name to look for 添加要查找的文件名
Sourcepub fn add_profile(self, profile: impl Into<String>) -> Self
pub fn add_profile(self, profile: impl Into<String>) -> Self
Add an active profile 添加活动配置文件
Sourcepub fn load(self) -> ConfigResult<Config>
pub fn load(self) -> ConfigResult<Config>
Load the configuration 加载配置
Trait Implementations§
Source§impl Clone for ConfigLoader
impl Clone for ConfigLoader
Source§fn clone(&self) -> ConfigLoader
fn clone(&self) -> ConfigLoader
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 ConfigLoader
impl Debug for ConfigLoader
Auto Trait Implementations§
impl Freeze for ConfigLoader
impl RefUnwindSafe for ConfigLoader
impl Send for ConfigLoader
impl Sync for ConfigLoader
impl Unpin for ConfigLoader
impl UnsafeUnpin for ConfigLoader
impl UnwindSafe for ConfigLoader
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