Struct inksac::types::ColoredString
source · pub struct ColoredString {
pub string: String,
pub style: Style,
}Expand description
String with the colored text
Example
use inksac::types::*;
let TITLESTYLE: Style = Style{
foreground: Some(Color::Green),
background: Some(Color::Red),
..Default::default()
};
let title_text: ColoredString = ColoredString::new(
"Hello World",
TITLESTYLE
);
println!("{}", title_text);Fields§
§string: String§style: StyleImplementations§
source§impl ColoredString
impl ColoredString
Trait Implementations§
source§impl Clone for ColoredString
impl Clone for ColoredString
source§fn clone(&self) -> ColoredString
fn clone(&self) -> ColoredString
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 Debug for ColoredString
impl Debug for ColoredString
Auto Trait Implementations§
impl RefUnwindSafe for ColoredString
impl Send for ColoredString
impl Sync for ColoredString
impl Unpin for ColoredString
impl UnwindSafe for ColoredString
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