Struct stylish_stringlike::text::Spans[][src]

pub struct Spans<T> { /* fields omitted */ }
Expand description

A string with various styles applied to the span. Styles do not not cascade. Only the most recent style applies to the current character.

Implementations

impl<T> Spans<T>[src]

pub fn spans(&self) -> impl Iterator<Item = Span<'_, T>> where
    T: Clone + Default
[src]

Returns the spans of text contained in this object.

Trait Implementations

impl<T> BoundedWidth for Spans<T>[src]

fn bounded_width(&self) -> usize[src]

Return the finite unicode width of an object Read more

impl<T: Clone> Clone for Spans<T>[src]

fn clone(&self) -> Spans<T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for Spans<T>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<T> Default for Spans<T>[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<'a, T: Paintable + Clone + Default> Display for Spans<T>[src]

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<T: Default + Clone + PartialEq> Expandable for Spans<T>[src]

fn expand(&self, capture: &Captures<'_>) -> Self[src]

Returns self with the desired capture group expanded into self. For String, this is just a wrapper around Captures::expand. Read more

impl<T> From<&'_ str> for Spans<T> where
    T: Clone + Default + PartialEq
[src]

fn from(other: &str) -> Spans<T>[src]

Performs the conversion.

impl<'a, T> FromIterator<Span<'a, T>> for Spans<T> where
    T: Clone + PartialEq + 'a, 
[src]

fn from_iter<I>(iter: I) -> Spans<T> where
    I: IntoIterator<Item = Span<'a, T>>, 
[src]

Creates a value from an iterator. Read more

impl<'a, T, U> FromIterator<U> for Spans<T> where
    T: Clone + PartialEq + 'a,
    U: Borrow<Spans<T>> + 'a, 
[src]

fn from_iter<I>(iter: I) -> Spans<T> where
    I: IntoIterator<Item = U>, 
[src]

Creates a value from an iterator. Read more

impl<T> HasWidth for Spans<T>[src]

fn width(&self) -> Width[src]

Return the unicode width of an object Read more

impl<T: PartialEq + Clone> Joinable<Span<'_, T>> for Spans<T>[src]

type Output = Spans<T>

fn join(&self, other: &Span<'_, T>) -> Self::Output[src]

Join an object to another object, returning an owned copy. Read more

impl<T: PartialEq + Clone> Joinable<Spans<T>> for Spans<T>[src]

type Output = Spans<T>

fn join(&self, other: &Spans<T>) -> Self::Output[src]

Join an object to another object, returning an owned copy. Read more

impl<T: PartialEq> PartialEq<Spans<T>> for Spans<T>[src]

fn eq(&self, other: &Spans<T>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<T> Pushable<&'_ str> for Spans<T>[src]

fn push(&mut self, other: &&str)[src]

Pushes another text object onto this one. String implements this trivially. Read more

impl<'a, T: Clone + PartialEq> Pushable<Span<'a, T>> for Spans<T>[src]

fn push(&mut self, other: &Span<'a, T>)[src]

Pushes another text object onto this one. String implements this trivially. Read more

impl<T: Clone + PartialEq> Pushable<Spans<T>> for Spans<T>[src]

fn push(&mut self, other: &Spans<T>)[src]

Pushes another text object onto this one. String implements this trivially. Read more

impl<T> Pushable<str> for Spans<T>[src]

fn push(&mut self, other: &str)[src]

Pushes another text object onto this one. String implements this trivially. Read more

impl<T> RawText for Spans<T>[src]

fn raw(&self) -> String[src]

Return an owned copy of the raw contents of the text object. Read more

fn raw_ref<'a>(&self) -> &str[src]

Return a reference ot the raw contents of the text object. Read more

impl<'a, T: Clone + PartialEq> Replaceable<&'a str> for Spans<T>[src]

fn replace(&self, from: &str, replacer: &'a str) -> Self[src]

Perform literal string replacement. Read more

fn replace_regex(&self, searcher: &Regex, replacer: &'a str) -> Self[src]

Perform regex string replacement. Read more

impl<'a, T: Clone> Sliceable for Spans<T>[src]

fn slice<R>(&self, range: R) -> Option<Self> where
    R: RangeBounds<usize> + Clone
[src]

Slice an underlying text object by bytes. Read more

impl<T: PartialEq> Eq for Spans<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Spans<T> where
    T: RefUnwindSafe

impl<T> Send for Spans<T> where
    T: Send

impl<T> Sync for Spans<T> where
    T: Sync

impl<T> Unpin for Spans<T>

impl<T> UnwindSafe for Spans<T> where
    T: RefUnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.