value
Styled text value for terminal output.
struct Component
pub struct ComponentA styled text value, typically paired with a Label in detail views.
| Field | Type | Description |
|---|---|---|
style |
Style | Style painted over the whole text. |
text |
String | Text shown as is, with no padding or truncation. |
Implements Display.
Component::new
pub fn new(text: impl Into<String>, style: Style) -> SelfCreate a value with the given display text and style.
| Parameter | Type | Description |
|---|---|---|
text |
impl Into<String> | the text to show |
style |
Style | the style to paint it in |
| returns | Self | The value, ready to display. |