pub struct ConfigManager { /* private fields */ }Expand description
配置管理器
负责加载、保存和管理配置信息
Implementations§
Source§impl ConfigManager
impl ConfigManager
Sourcepub fn settings(&self) -> &GaiaSettings
pub fn settings(&self) -> &GaiaSettings
获取当前设置
Sourcepub fn config(&self) -> &GaiaSettings
pub fn config(&self) -> &GaiaSettings
获取当前设置 (兼容旧代码)
Sourcepub fn get_global_setting(&self, key: &str) -> Option<&str>
pub fn get_global_setting(&self, key: &str) -> Option<&str>
获取全局设置
Sourcepub fn set_global_setting(&mut self, key: String, value: String)
pub fn set_global_setting(&mut self, key: String, value: String)
设置全局设置
Sourcepub fn get_platform_config(
&self,
target: &CompilationTarget,
) -> Option<&PlatformConfig>
pub fn get_platform_config( &self, target: &CompilationTarget, ) -> Option<&PlatformConfig>
获取平台配置
Sourcepub fn add_platform_config(
&mut self,
target: CompilationTarget,
config: PlatformConfig,
)
pub fn add_platform_config( &mut self, target: CompilationTarget, config: PlatformConfig, )
添加平台配置
Sourcepub fn add_adapter_config(&mut self, config: AdapterConfigEntry)
pub fn add_adapter_config(&mut self, config: AdapterConfigEntry)
添加适配器配置
Sourcepub fn get_adapter_config(&self, name: &str) -> Option<&AdapterConfigEntry>
pub fn get_adapter_config(&self, name: &str) -> Option<&AdapterConfigEntry>
获取适配器配置
Sourcepub fn add_function_mapping(&mut self, mapping: FunctionMapping)
pub fn add_function_mapping(&mut self, mapping: FunctionMapping)
添加函数映射
Sourcepub fn get_function_mapping(
&self,
common_name: &str,
platform: &str,
) -> Option<&str>
pub fn get_function_mapping( &self, common_name: &str, platform: &str, ) -> Option<&str>
获取函数映射
Sourcepub fn config_path(&self) -> Option<&str>
pub fn config_path(&self) -> Option<&str>
获取当前配置文件的路径
Auto Trait Implementations§
impl Freeze for ConfigManager
impl RefUnwindSafe for ConfigManager
impl Send for ConfigManager
impl Sync for ConfigManager
impl Unpin for ConfigManager
impl UnsafeUnpin for ConfigManager
impl UnwindSafe for ConfigManager
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