Struct prototty_common::RichText
[−]
[src]
pub struct RichText { pub parts: Vec<RichTextPart>, pub size: Size, }
A text element, where the style of the text
can be controlled. A single RichText
element can have
several different parts, each styled differently.
Fields
parts: Vec<RichTextPart>
size: Size
Methods
impl RichText
[src]
pub fn new<S>(parts: Vec<(S, TextInfo)>, size: Size) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Create a new RichText
element.
pub fn one_line<S>(parts: Vec<(S, TextInfo)>) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Create a new Text
element of an appropriate
size for a single line.
Trait Implementations
impl Debug for RichText
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for RichText
[src]
fn clone(&self) -> RichText
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl View<RichText> for DefaultRichTextView
[src]
fn view<G: ViewGrid>(
&mut self,
data: &RichText,
offset: Coord,
depth: i32,
grid: &mut G
)
[src]
&mut self,
data: &RichText,
offset: Coord,
depth: i32,
grid: &mut G
)
Update the cells in grid
to describe how a type should be rendered.