use crate::*;
impl<'a> Default for OutputBuilder<'a> {
#[inline(always)]
fn default() -> Self {
Self::new()
}
}
impl<'a> OutputBuilder<'a> {
#[inline(always)]
pub fn new() -> Self {
Self {
output: Output::default(),
}
}
#[inline(always)]
pub fn new_from(output: Output<'a>) -> Self {
Self { output }
}
#[inline(always)]
pub fn text(&mut self, text: &'a str) -> &mut Self {
self.output.text = text;
self
}
#[inline(always)]
pub fn color(&mut self, color: ColorType) -> &mut Self {
self.output.color = color;
self
}
#[inline(always)]
pub fn bg_color(&mut self, bg_color: ColorType) -> &mut Self {
self.output.bg_color = bg_color;
self
}
#[inline(always)]
pub fn bold(&mut self, bold: bool) -> &mut Self {
self.output.bold = bold;
self
}
#[inline(always)]
pub fn endl(&mut self, endl: bool) -> &mut Self {
self.output.endl = endl;
self
}
#[inline(always)]
pub fn build(&'_ self) -> Output<'_> {
self.output
}
#[inline(always)]
pub fn output(&self) {
output(self.output);
}
}