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.
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.