[][src]Struct html2text::render::text_renderer::TaggedLine

pub struct TaggedLine<T: Debug + Eq + PartialEq + Clone> { /* fields omitted */ }

A line of tagged text (composed of a set of TaggedStrings).

Implementations

impl<T: Debug + Eq + PartialEq + Clone + Default> TaggedLine<T>[src]

pub fn new() -> TaggedLine<T>[src]

Create an empty TaggedLine.

pub fn from_string(s: String, tag: &T) -> TaggedLine<T>[src]

Create a new TaggedLine from a string and tag.

pub fn into_string(self) -> String[src]

Join the line into a String, ignoring the tags and markers.

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

Return true if the line is non-empty

pub fn push_str(&mut self, ts: TaggedString<T>)[src]

Add a new tagged string fragment to the line

pub fn push(&mut self, tle: TaggedLineElement<T>)[src]

Add a new general TaggedLineElement to the line

pub fn insert_front(&mut self, ts: TaggedString<T>)[src]

Add a new fragment to the start of the line

pub fn push_char(&mut self, c: char, tag: &T)[src]

Add text with a particular tag to self

pub fn consume(&mut self, tl: &mut TaggedLine<T>)[src]

Drain tl and use to extend self.

pub fn drain_all(&mut self) -> Drain<'_, TaggedLineElement<T>>[src]

Drain the contained items

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

Iterator over the chars in this line.

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

Iterator over TaggedLineElements

pub fn width(&self) -> usize[src]

Return the width of the line in cells

pub fn pad_to(&mut self, width: usize)[src]

Pad this line to width with spaces (or if already at least this wide, do nothing).

Trait Implementations

impl<T: Debug + Eq + PartialEq + Clone> Debug for TaggedLine<T>[src]

impl<T: PartialEq + Debug + Eq + Clone> PartialEq<TaggedLine<T>> for TaggedLine<T>[src]

impl<T: Debug + Eq + PartialEq + Clone> StructuralPartialEq for TaggedLine<T>[src]

Auto Trait Implementations

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

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

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

impl<T> Unpin for TaggedLine<T> where
    T: Unpin

impl<T> UnwindSafe for TaggedLine<T> where
    T: UnwindSafe

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.