Trait rosu_map::util::StrExt

source ·
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§

source

fn trim_comment(&self) -> &str

Trim trailing comments and whitespace.

source

fn parse_num<N: ParseNumber>(&self) -> Result<N, ParseNumberError>

Parse &str to a number without exceeding MAX_PARSE_VALUE.

source

fn parse_with_limits<N: ParseNumber>( &self, limit: N ) -> Result<N, ParseNumberError>

Parse &str to a number without exceeding the given limit.

source

fn to_standardized_path(&self) -> String

Replace windows path separators with unix ones.

source

fn clean_filename(&self) -> String

Fix path and quotation segments to normalize filenames.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl StrExt for str

Implementors§