color_output/output/
output.rs

1use crate::*;
2use task::r#type::Task;
3use text::r#type::Text;
4
5/// Output
6///
7/// [Official Documentation](https://docs.ltpp.vip/COLOR-OUTPUT/),
8///
9/// # Parameters
10/// - `Output`: The output struct
11///
12/// # Code Example
13///
14/// ## Using the Struct
15///
16/// ### Using the output Function
17///
18/// ```rust
19/// use color_output::*;
20/// ```
21///
22/// ## Using the Constructor
23///
24/// ### Using the output Function
25///
26/// ```rust
27/// use color_output::*;
28/// ```
29pub fn output(output: Output) {
30    // Text
31    let text: &str = output.text;
32    let color: ColorType = output.color.clone();
33    let bg_color: ColorType = output.bg_color.clone();
34    let blod: bool = output.blod.clone();
35    // endl
36    let endl: bool = output.endl;
37    let mut task_list: Task<'_> = Task::default();
38    // Add text
39    task_list.add(Text {
40        text,
41        color,
42        bg_color,
43        blod,
44        endl,
45    });
46    // run
47    task_list.run_all();
48}