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 StyledStrings

Required Methods§

source

fn char_len(&self) -> usize

The amount of UTF-8 characters in the source string

source

fn chars(&self) -> Chars<'_>

Iterate over the characters in the source string

Disclaimer: some special characters are actually multiple characters (like accented letters)

source

fn to_spanned_string(&self) -> SpannedString<T>

Convert the SpannedStr back to a SpannedString

source

fn as_spanned_str(&self) -> SpannedStr<'_, T>

Creates a SpannedStr reference from a SpannedString

Implementations on Foreign Types§

source§

impl<T: Clone> SpannedStrExt<T> for SpannedString<T>

source§

impl<'a, T: Clone> SpannedStrExt<T> for SpannedStr<'a, T>

Implementors§