ltpp_output/output/
type.rs

1use super::output::output;
2use crate::*;
3
4/// Output struct
5///
6/// [Official Documentation](https://docs.ltpp.vip/LTPP-RUST-OUTPUT/),
7///
8/// # Code Example
9///
10/// ## Using the Struct
11///
12/// ### Using the output Function
13///
14/// ```rust
15/// use ltpp_output::*;
16/// output(Output {
17///     text: "test_output_struct",
18///     text_color: ColorType::Use(Color::Default),
19///     text_bg_color: ColorType::Color256(0x000000),
20///     show_time: true,
21///     time_text_color: ColorType::Rgb(255, 255, 255),
22///     time_bg_color: ColorType::Use(Color::Yellow),
23///     split: " => ",
24///     split_color: ColorType::Use(Color::Cyan),
25///     split_bg_color: ColorType::Use(Color::Yellow),
26///     endl: true,
27///     ..Default::default()
28/// });
29/// ```
30///
31/// ### Using the output Method
32///
33/// ```rust
34/// use ltpp_output::*;
35/// Output {
36///     text: "test_output_struct_output",
37///     text_color: ColorType::Use(Color::Default),
38///     text_bg_color: ColorType::Use(Color::Blue),
39///     show_time: true,
40///     time_text_color: ColorType::Rgb(255, 255, 255),
41///     time_bg_color: ColorType::Use(Color::Yellow),
42///     split: " => ",
43///     split_color: ColorType::Use(Color::Cyan),
44///     split_bg_color: ColorType::Use(Color::Yellow),
45///     endl: true,
46///     ..Default::default()
47/// }
48/// .output();
49/// ```
50#[derive(Debug, Clone)]
51pub struct Output<'a> {
52    /// text
53    pub text: &'a str,
54    /// text color
55    pub text_color: ColorType,
56    /// Text background color
57    pub text_bg_color: ColorType,
58    /// Bold text
59    pub text_blod: bool,
60    /// Whether to show time
61    pub show_time: bool,
62    /// Time text color
63    pub time_text_color: ColorType,
64    /// Time background color
65    pub time_bg_color: ColorType,
66    /// Time text bold
67    pub time_text_blod: bool,
68    /// Separator
69    pub split: &'a str,
70    /// Separator text color
71    pub split_color: ColorType,
72    /// Separator background color
73    pub split_bg_color: ColorType,
74    /// Separator text bold
75    pub split_text_blod: bool,
76    /// endl
77    pub endl: bool,
78}