use super::types::{BoolAlign, BoolFormat};
impl BoolFormat {
pub fn new() -> BoolFormat {
BoolFormat::default()
}
pub fn width(mut self, width: usize) -> BoolFormat {
self.min_width = width;
self.max_width = width;
self
}
pub fn min_width(mut self, min_width: usize) -> BoolFormat {
self.min_width = min_width;
self
}
pub fn max_width(mut self, max_width: usize) -> BoolFormat {
self.max_width = max_width;
self
}
pub fn width_option(self, width: Option<usize>) -> BoolFormat {
self.min_width_option(width).max_width_option(width)
}
pub fn min_width_option(mut self, width: Option<usize>) -> BoolFormat {
match width {
Some(width) => {
self.min_width = width;
self
}
None => self,
}
}
pub fn max_width_option(mut self, width: Option<usize>) -> BoolFormat {
match width {
Some(width) => {
self.max_width = width;
self
}
None => self,
}
}
pub fn left_align(mut self) -> BoolFormat {
self.align = BoolAlign::Left;
self
}
pub fn right_align(mut self) -> BoolFormat {
self.align = BoolAlign::Right;
self
}
pub fn fill_char(mut self, fill_char: char) -> BoolFormat {
self.fill_char = fill_char;
self
}
pub fn true_text(mut self, true_text: String) -> BoolFormat {
self.true_text = true_text;
self
}
pub fn false_text(mut self, false_text: String) -> BoolFormat {
self.false_text = false_text;
self
}
}