ratatui::text

Trait ToLine

Source
pub trait ToLine {
    // Required method
    fn to_line(&self) -> Line<'_>;
}
Expand description

A trait for converting a value to a Line.

This trait is automatically implemented for any type that implements the Display trait. As such, ToLine shouln’t be implemented directly: Display should be implemented instead, and you get the ToLine implementation for free.

Required Methods§

Source

fn to_line(&self) -> Line<'_>

Converts the value to a Line.

Implementors§

Source§

impl<T: Display> ToLine for T

§Panics

In this implementation, the to_line method panics if the Display implementation returns an error. This indicates an incorrect Display implementation since fmt::Write for String never returns an error itself.