pub trait SpannedStrExt<T>: Clone {
// Required methods
fn char_len(&self) -> usize;
fn chars(&self) -> Chars<'_>;
fn to_spanned_string(&self) -> SpannedString<T>;
fn as_spanned_str(&self) -> SpannedStr<'_, T>;
}
Expand description
Extension trait for SpannedString
and SpannedStr
These methods might be useful when working with StyledString
s
Required Methods§
Sourcefn chars(&self) -> Chars<'_>
fn chars(&self) -> Chars<'_>
Iterate over the characters in the source string
Disclaimer: some special characters are actually multiple characters (like accented letters)
Sourcefn to_spanned_string(&self) -> SpannedString<T>
fn to_spanned_string(&self) -> SpannedString<T>
Convert the SpannedStr
back to a SpannedString
Sourcefn as_spanned_str(&self) -> SpannedStr<'_, T>
fn as_spanned_str(&self) -> SpannedStr<'_, T>
Creates a SpannedStr
reference from a SpannedString
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.