pub trait MyParseFormat {
// Required methods
fn parse_all(&self) -> Result<String>;
fn parse_format(&self) -> Result<String>;
fn parse_replace<F>(
&self,
start: char,
end: char,
match_value: F,
) -> Result<String>
where F: Fn(String) -> String;
fn parse_replace_zh<F>(
&self,
start: char,
end: char,
match_value: F,
) -> Result<String>
where F: Fn(String) -> String;
fn parse_env(&self) -> Result<String>;
fn parse_path(&self) -> String;
}Expand description
解析格式化字符串
Required Methods§
Sourcefn parse_format(&self) -> Result<String>
fn parse_format(&self) -> Result<String>
解析特殊关键词
Sourcefn parse_replace<F>(
&self,
start: char,
end: char,
match_value: F,
) -> Result<String>
fn parse_replace<F>( &self, start: char, end: char, match_value: F, ) -> Result<String>
解析自定义关键词
Sourcefn parse_replace_zh<F>(
&self,
start: char,
end: char,
match_value: F,
) -> Result<String>
fn parse_replace_zh<F>( &self, start: char, end: char, match_value: F, ) -> Result<String>
解析含中文自定义关键词
Sourcefn parse_path(&self) -> String
fn parse_path(&self) -> String
解析路径规范,统一’/’
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.