pub struct Output<'a> {
pub text: &'a str,
pub text_color: Option<ColorType>,
pub text_bg_color: Option<ColorType>,
pub text_blod: Option<bool>,
pub show_time: Option<bool>,
pub time_text_color: Option<ColorType>,
pub time_bg_color: Option<ColorType>,
pub time_text_blod: Option<bool>,
pub split: Option<&'a str>,
pub split_color: Option<ColorType>,
pub split_bg_color: Option<ColorType>,
pub split_text_blod: Option<bool>,
}
Expand description
Output struct
§Code Example
§Using the Struct
§Using the output Function
use ltpp_output::*;
output(Output {
text: "test_output_struct",
text_color: Some(ColorType::Use(Color::Default)),
text_bg_color: Some(ColorType::Color256(0x000000)),
show_time: Some(true),
time_text_color: Some(ColorType::Rgb(255, 255, 255)),
time_bg_color: Some(ColorType::Use(Color::Yellow)),
split: Some(" => "),
split_color: Some(ColorType::Use(Color::Cyan)),
split_bg_color: Some(ColorType::Use(Color::Yellow)),
..Default::default()
});
§Using the output Method
use ltpp_output::*;
Output {
text: "test_output_struct_output",
text_color: Some(ColorType::Use(Color::Default)),
text_bg_color: Some(ColorType::Color256(0x000000)),
show_time: Some(true),
time_text_color: Some(ColorType::Rgb(255, 255, 255)),
time_bg_color: Some(ColorType::Use(Color::Yellow)),
split: Some(" => "),
split_color: Some(ColorType::Use(Color::Cyan)),
split_bg_color: Some(ColorType::Use(Color::Yellow)),
..Default::default()
}
.output();
§Using the Constructor
§Using the output Function
use ltpp_output::*;
output(
OutputBuilder::new()
.set_text("test_output_builder")
.set_text_color(ColorType::Color256(0xffffff))
.set_time_text_color(ColorType::Rgb(255, 200, 255))
.set_text_blod(true)
.set_time_text_blod(true)
.set_show_time(true)
.build(),
);
§Using the output Method
use ltpp_output::*;
OutputBuilder::new()
.set_text("test_output_builder_output")
.set_text("test_output_builder")
.set_text_color(ColorType::Color256(0xffffff))
.set_time_text_color(ColorType::Rgb(255, 200, 255))
.set_text_blod(true)
.set_time_text_blod(true)
.set_show_time(true)
.build()
.output();
Fields§
§text: &'a str
text
text_color: Option<ColorType>
text color
text_bg_color: Option<ColorType>
Text background color
text_blod: Option<bool>
Bold text
show_time: Option<bool>
Whether to show time
time_text_color: Option<ColorType>
Time text color
time_bg_color: Option<ColorType>
Time background color
time_text_blod: Option<bool>
Time text bold
split: Option<&'a str>
Separator
split_color: Option<ColorType>
Separator text color
split_bg_color: Option<ColorType>
Separator background color
split_text_blod: Option<bool>
Separator text bold
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Output<'a>
impl<'a> RefUnwindSafe for Output<'a>
impl<'a> Send for Output<'a>
impl<'a> Sync for Output<'a>
impl<'a> Unpin for Output<'a>
impl<'a> UnwindSafe for Output<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)