pub struct Configuration {
pub countries_config: CountriesConfig,
pub patterns: PatternConfig,
pub settings: ParserSettings,
}Expand description
完整配置
Fields§
§countries_config: CountriesConfig国家配置
patterns: PatternConfig模式配置
settings: ParserSettings解析器设置
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn load() -> Result<Self, ParseError>
pub fn load() -> Result<Self, ParseError>
从多个嵌入的JSON文件加载配置
Sourcepub fn create_country_mapping(&self) -> HashMap<String, &CountryInfo>
pub fn create_country_mapping(&self) -> HashMap<String, &CountryInfo>
创建国家代码到国家信息的映射
Sourcepub fn get_settings(&self) -> &ParserSettings
pub fn get_settings(&self) -> &ParserSettings
获取解析器设置
Sourcepub fn get_patterns(&self) -> &PatternConfig
pub fn get_patterns(&self) -> &PatternConfig
获取模式配置
Sourcepub fn get_countries(&self) -> &[CountryInfo]
pub fn get_countries(&self) -> &[CountryInfo]
获取所有国家信息
Sourcepub fn get_version(&self) -> &str
pub fn get_version(&self) -> &str
获取配置版本
Trait Implementations§
Source§impl Clone for Configuration
impl Clone for Configuration
Source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Configuration
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
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