[][src]Enum nnsplit::Split

pub enum Split<'a> {
    Text(&'a str),
    Split((&'a str, Vec<Split<'a>>)),
}

A splitted text.

Variants

Text(&'a str)

The lowest level of split.

Split((&'a str, Vec<Split<'a>>))

A split which contains one or more smaller splits.

Implementations

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

pub fn text(&self) -> &'a str[src]

Returns the encompassed text.

pub fn iter(&self) -> impl Iterator<Item = &Split<'a>>[src]

Iterate over smaller splits.

Panics

  • If the Split is a Split::Text because the lowest level of split can not be iterated over.

pub fn flatten(&self, level: usize) -> Vec<&str>[src]

Recursively flatten the split. Returns a vector where each item is the text of the split at the lowest level.

Trait Implementations

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for Split<'a>

impl<'a> Send for Split<'a>

impl<'a> Sync for Split<'a>

impl<'a> Unpin for Split<'a>

impl<'a> UnwindSafe for Split<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[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, 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.