color_output/output/
fn.rs

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