e_utils::parse

Trait MyParseFormat

Source
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§

Source

fn parse_all(&self) -> Result<String>

解析所有

Source

fn parse_format(&self) -> Result<String>

解析特殊关键词

Source

fn parse_replace<F>( &self, start: char, end: char, match_value: F, ) -> Result<String>
where F: Fn(String) -> String,

解析自定义关键词

Source

fn parse_replace_zh<F>( &self, start: char, end: char, match_value: F, ) -> Result<String>
where F: Fn(String) -> String,

解析含中文自定义关键词

Source

fn parse_env(&self) -> Result<String>

解析系统环境变量 解析跨平台系统环境变量(windows、linux、mac等)

Source

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.

Implementations on Foreign Types§

Source§

impl MyParseFormat for Path

Source§

fn parse_format(&self) -> Result<String>

Source§

fn parse_env(&self) -> Result<String>

Source§

fn parse_all(&self) -> Result<String>

Source§

fn parse_path(&self) -> String

Source§

fn parse_replace<F>( &self, start: char, end: char, match_value: F, ) -> Result<String>
where F: Fn(String) -> String,

Source§

fn parse_replace_zh<F>( &self, start: char, end: char, match_value: F, ) -> Result<String>
where F: Fn(String) -> String,

Implementors§