pub trait StrExt {
// Required methods
fn trim_comment(&self) -> &str;
fn parse_num<N: ParseNumber>(&self) -> Result<N, ParseNumberError>;
fn parse_with_limits<N: ParseNumber>(
&self,
limit: N
) -> Result<N, ParseNumberError>;
fn to_standardized_path(&self) -> String;
fn clean_filename(&self) -> String;
}Expand description
Extension methods for str which are commonly used in and around this library.
Required Methods§
sourcefn trim_comment(&self) -> &str
fn trim_comment(&self) -> &str
Trim trailing comments and whitespace.
sourcefn parse_num<N: ParseNumber>(&self) -> Result<N, ParseNumberError>
fn parse_num<N: ParseNumber>(&self) -> Result<N, ParseNumberError>
Parse &str to a number without exceeding MAX_PARSE_VALUE.
sourcefn parse_with_limits<N: ParseNumber>(
&self,
limit: N
) -> Result<N, ParseNumberError>
fn parse_with_limits<N: ParseNumber>( &self, limit: N ) -> Result<N, ParseNumberError>
Parse &str to a number without exceeding the given limit.
sourcefn to_standardized_path(&self) -> String
fn to_standardized_path(&self) -> String
Replace windows path separators with unix ones.
sourcefn clean_filename(&self) -> String
fn clean_filename(&self) -> String
Fix path and quotation segments to normalize filenames.
Object Safety§
This trait is not object safe.