pub struct Output<'a> {Show 16 fields
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 show_code_location: Option<bool>,
pub code_location_text_color: Option<ColorType>,
pub code_location_bg_color: Option<ColorType>,
pub code_location_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 函数
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),
show_code_location: Some(true),
time_text_color: Some(ColorType::Rgb(255, 255, 255)),
time_bg_color: Some(ColorType::Use(Color::Yellow)),
code_location_text_color: Some(ColorType::Color256(0xffffff)),
code_location_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 方法
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),
show_code_location: Some(true),
time_text_color: Some(ColorType::Rgb(255, 255, 255)),
time_bg_color: Some(ColorType::Use(Color::Yellow)),
code_location_text_color: Some(ColorType::Color256(0xffffff)),
code_location_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();
§使用构造器
§使用 output 函数
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_code_location_text_color(ColorType::Use(Color::Yellow))
.set_text_blod(true)
.set_time_text_blod(true)
.set_code_location_text_blod(true)
.set_show_time(true)
.set_show_code_location(true)
.build(),
);
§使用 output 方法
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_code_location_text_color(ColorType::Use(Color::Yellow))
.set_text_blod(true)
.set_time_text_blod(true)
.set_code_location_text_blod(true)
.set_show_time(true)
.set_show_code_location(true)
.build()
.output();
Fields§
§text: &'a str
输出文字
text_color: Option<ColorType>
输出文字颜色
text_bg_color: Option<ColorType>
输出文字背景颜色
text_blod: Option<bool>
文字加粗
show_time: Option<bool>
是否显示时间
time_text_color: Option<ColorType>
时间文字颜色
time_bg_color: Option<ColorType>
时间背景颜色
time_text_blod: Option<bool>
时间文字加粗
show_code_location: Option<bool>
是否显示代码位置
code_location_text_color: Option<ColorType>
代码位置文字颜色
code_location_bg_color: Option<ColorType>
代码位置背景颜色
code_location_text_blod: Option<bool>
代码位置文字加粗
split: Option<&'a str>
分隔符
split_color: Option<ColorType>
分隔符文字颜色
split_bg_color: Option<ColorType>
分隔符背景颜色
split_text_blod: Option<bool>
分隔符文字加粗
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
)