Lines Matching refs:str
78 use std::str::FromStr;
160 pub fn glob(pattern: &str) -> Result<Paths, PatternError> {
177 pub fn glob_with(pattern: &str, options: MatchOptions) -> Result<Paths, PatternError> {
297 fn description(&self) -> &str {
447 pub msg: &'static str,
451 fn description(&self) -> &str {
508 fn from_str(s: &str) -> Result<Self, PatternError> {
536 const ERROR_WILDCARDS: &str = "wildcards are either regular `*` or recursive `**`";
537 const ERROR_RECURSIVE_WILDCARDS: &str = "recursive wildcards must form a single path \
539 const ERROR_INVALID_RANGE: &str = "invalid range pattern";
545 pub fn new(pattern: &str) -> Result<Self, PatternError> {
661 pub fn escape(s: &str) -> String {
680 /// Return if the given `str` matches this `Pattern` using the default
692 pub fn matches(&self, str: &str) -> bool {
693 self.matches_with(str, MatchOptions::new())
696 /// Return if the given `Path`, when converted to a `str`, matches this
703 /// Return if the given `str` matches this `Pattern` using the specified
705 pub fn matches_with(&self, str: &str, options: MatchOptions) -> bool {
706 self.matches_from(true, str.chars(), 0, options) == Match
709 /// Return if the given `Path`, when converted to a `str`, matches this
718 pub fn as_str(&self) -> &str {
725 mut file: std::str::Chars,