pub trait InfraStr {
// Required methods
fn normalize_newlines(&self) -> String;
fn strip_newlines(&self) -> String;
fn trim_ascii_whitespace(&self) -> &str;
fn trim_collapse_ascii_whitespace(&self) -> String;
fn collect_codepoints<P>(
&self,
position: &mut usize,
predicate: P,
) -> String
where P: Fn(char) -> bool;
fn skip_codepoints<P>(&self, position: &mut usize, predicate: P)
where P: Fn(char) -> bool;
fn skip_ascii_whitespace(&self, position: &mut usize);
}
Expand description
Methods from the WHATWG Infra Standard for strings
Required Methods§
Sourcefn normalize_newlines(&self) -> String
fn normalize_newlines(&self) -> String
See the documentation for normalize_newlines()
Sourcefn strip_newlines(&self) -> String
fn strip_newlines(&self) -> String
See the documentation for strip_newlines()
Sourcefn trim_ascii_whitespace(&self) -> &str
fn trim_ascii_whitespace(&self) -> &str
See the documentation for trim_ascii_whitespace()
Sourcefn trim_collapse_ascii_whitespace(&self) -> String
fn trim_collapse_ascii_whitespace(&self) -> String
See the documentation for trim_collapse_ascii_whitespace()
Sourcefn collect_codepoints<P>(&self, position: &mut usize, predicate: P) -> String
fn collect_codepoints<P>(&self, position: &mut usize, predicate: P) -> String
See the documentation for collect_codepoints()
Sourcefn skip_codepoints<P>(&self, position: &mut usize, predicate: P)
fn skip_codepoints<P>(&self, position: &mut usize, predicate: P)
See the documentation for skip_codepoints()
fn skip_ascii_whitespace(&self, position: &mut usize)
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.