Struct html2text::render::text_renderer::TaggedLine
source · pub struct TaggedLine<T> { /* private fields */ }
Expand description
A line of tagged text (composed of a set of TaggedString
s).
Implementations§
source§impl<T: Debug + Eq + PartialEq + Clone + Default> TaggedLine<T>
impl<T: Debug + Eq + PartialEq + Clone + Default> TaggedLine<T>
sourcepub fn new() -> TaggedLine<T>
pub fn new() -> TaggedLine<T>
Create an empty TaggedLine
.
sourcepub fn from_string(s: String, tag: &T) -> TaggedLine<T>
pub fn from_string(s: String, tag: &T) -> TaggedLine<T>
Create a new TaggedLine from a string and tag.
sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Join the line into a String, ignoring the tags and markers.
sourcepub fn push_str(&mut self, ts: TaggedString<T>)
pub fn push_str(&mut self, ts: TaggedString<T>)
Add a new tagged string fragment to the line
sourcepub fn push(&mut self, tle: TaggedLineElement<T>)
pub fn push(&mut self, tle: TaggedLineElement<T>)
Add a new general TaggedLineElement to the line
sourcepub fn insert_front(&mut self, ts: TaggedString<T>)
pub fn insert_front(&mut self, ts: TaggedString<T>)
Add a new fragment to the start of the line
sourcepub fn consume(&mut self, tl: &mut TaggedLine<T>)
pub fn consume(&mut self, tl: &mut TaggedLine<T>)
Drain tl and use to extend self.
sourcepub fn drain_all(&mut self) -> Drain<'_, TaggedLineElement<T>>
pub fn drain_all(&mut self) -> Drain<'_, TaggedLineElement<T>>
Drain the contained items
sourcepub fn chars<'a>(&'a self) -> impl Iterator<Item = char> + 'a
pub fn chars<'a>(&'a self) -> impl Iterator<Item = char> + 'a
Iterator over the chars in this line.
sourcepub fn iter<'a>(&'a self) -> impl Iterator<Item = &TaggedLineElement<T>> + 'a
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &TaggedLineElement<T>> + 'a
Iterator over TaggedLineElements
sourcepub fn tagged_strings(&self) -> impl Iterator<Item = &TaggedString<T>>
pub fn tagged_strings(&self) -> impl Iterator<Item = &TaggedString<T>>
Iterator over the tagged strings in this line, ignoring any fragments.
sourcepub fn into_tagged_strings(self) -> impl Iterator<Item = TaggedString<T>>
pub fn into_tagged_strings(self) -> impl Iterator<Item = TaggedString<T>>
Converts the tagged line into an iterator over the tagged strings in this line, ignoring any fragments.
Trait Implementations§
source§impl<T: Clone> Clone for TaggedLine<T>
impl<T: Clone> Clone for TaggedLine<T>
source§fn clone(&self) -> TaggedLine<T>
fn clone(&self) -> TaggedLine<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for TaggedLine<T>
impl<T: Debug> Debug for TaggedLine<T>
source§impl<T: PartialEq> PartialEq for TaggedLine<T>
impl<T: PartialEq> PartialEq for TaggedLine<T>
source§fn eq(&self, other: &TaggedLine<T>) -> bool
fn eq(&self, other: &TaggedLine<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T> StructuralPartialEq for TaggedLine<T>
Auto Trait Implementations§
impl<T> Freeze for TaggedLine<T>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more