[][src]Struct skim::AnsiString

pub struct AnsiString<'a> { /* fields omitted */ }

A String that contains ANSI state (e.g. colors)

It is internally represented as Vec<(attr, string)>

Implementations

impl<'a> AnsiString<'a>[src]

pub fn new_empty() -> Self[src]

pub fn new_str(stripped: &'a str, fragments: Vec<(Attr, (u32, u32))>) -> Self[src]

assume the fragments are ordered by (start, end) while end is exclusive

pub fn new_string(stripped: String, fragments: Vec<(Attr, (u32, u32))>) -> Self[src]

assume the fragments are ordered by (start, end) while end is exclusive

pub fn parse(raw: &'a str) -> AnsiString<'static>[src]

pub fn is_empty(&self) -> bool[src]

pub fn into_inner(self) -> Cow<'a, str>[src]

pub fn iter(&'a self) -> Box<dyn Iterator<Item = (char, Attr)> + 'a>[src]

pub fn has_attrs(&self) -> bool[src]

pub fn stripped(&self) -> &str[src]

pub fn override_attrs(&mut self, attrs: Vec<(Attr, (u32, u32))>)[src]

Trait Implementations

impl<'a> Clone for AnsiString<'a>[src]

impl<'a> Debug for AnsiString<'a>[src]

impl<'a> From<&'a str> for AnsiString<'a>[src]

impl<'a> From<(&'a str, &'a [usize], Attr)> for AnsiString<'a>[src]

impl<'a> From<DisplayContext<'a>> for AnsiString<'a>[src]

impl From<String> for AnsiString<'static>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for AnsiString<'a>

impl<'a> Send for AnsiString<'a>

impl<'a> Sync for AnsiString<'a>

impl<'a> Unpin for AnsiString<'a>

impl<'a> UnwindSafe for AnsiString<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsAny for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.