[−][src]Struct html2text::render::text_renderer::TaggedLine
A line of tagged text (composed of a set of TaggedString
s).
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]
&'a self
) -> Box<dyn Iterator<Item = &TaggedLineElement<T>> + 'a>
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]
fn eq(&self, other: &TaggedLine<T>) -> bool
[src]
fn ne(&self, other: &TaggedLine<T>) -> bool
[src]
impl<T: Debug + Eq + PartialEq + Clone> StructuralPartialEq for TaggedLine<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for TaggedLine<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for TaggedLine<T> where
T: Send,
T: Send,
impl<T> Sync for TaggedLine<T> where
T: Sync,
T: Sync,
impl<T> Unpin for TaggedLine<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for TaggedLine<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,