Struct etop_format::bool_format::BoolFormat
source · pub struct BoolFormat {
pub min_width: usize,
pub max_width: usize,
pub align: BoolAlign,
pub fill_char: char,
pub true_text: String,
pub false_text: String,
}Expand description
bool format specification
Fields§
§min_width: usizemin_width of bool, for padding
max_width: usizemax_width of bool, for padding
align: BoolAlignalign bool to left or right
fill_char: charfill padding char
true_text: Stringtrue string
false_text: Stringfalse string
Implementations§
source§impl BoolFormat
impl BoolFormat
sourcepub fn new() -> BoolFormat
pub fn new() -> BoolFormat
create new number format
sourcepub fn width(self, width: usize) -> BoolFormat
pub fn width(self, width: usize) -> BoolFormat
set width
sourcepub fn min_width(self, min_width: usize) -> BoolFormat
pub fn min_width(self, min_width: usize) -> BoolFormat
set min_width
sourcepub fn max_width(self, max_width: usize) -> BoolFormat
pub fn max_width(self, max_width: usize) -> BoolFormat
set max_width
sourcepub fn width_option(self, width: Option<usize>) -> BoolFormat
pub fn width_option(self, width: Option<usize>) -> BoolFormat
set width
sourcepub fn min_width_option(self, width: Option<usize>) -> BoolFormat
pub fn min_width_option(self, width: Option<usize>) -> BoolFormat
set min_width
sourcepub fn max_width_option(self, width: Option<usize>) -> BoolFormat
pub fn max_width_option(self, width: Option<usize>) -> BoolFormat
set max_width
sourcepub fn left_align(self) -> BoolFormat
pub fn left_align(self) -> BoolFormat
left align
sourcepub fn right_align(self) -> BoolFormat
pub fn right_align(self) -> BoolFormat
right align
sourcepub fn fill_char(self, fill_char: char) -> BoolFormat
pub fn fill_char(self, fill_char: char) -> BoolFormat
add fill char
sourcepub fn true_text(self, true_text: String) -> BoolFormat
pub fn true_text(self, true_text: String) -> BoolFormat
true format
sourcepub fn false_text(self, false_text: String) -> BoolFormat
pub fn false_text(self, false_text: String) -> BoolFormat
false format
source§impl BoolFormat
impl BoolFormat
sourcepub fn format_option<S: AsRef<str>>(
&self,
s: Option<bool>,
none_str: S
) -> Result<String, FormatError>
pub fn format_option<S: AsRef<str>>( &self, s: Option<bool>, none_str: S ) -> Result<String, FormatError>
format bool data
Trait Implementations§
source§impl Clone for BoolFormat
impl Clone for BoolFormat
source§fn clone(&self) -> BoolFormat
fn clone(&self) -> BoolFormat
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for BoolFormat
impl Debug for BoolFormat
source§impl Default for BoolFormat
impl Default for BoolFormat
source§fn default() -> BoolFormat
fn default() -> BoolFormat
Returns the “default value” for a type. Read more
source§impl From<BoolFormat> for CellFormatShorthand
impl From<BoolFormat> for CellFormatShorthand
source§fn from(format: BoolFormat) -> CellFormatShorthand
fn from(format: BoolFormat) -> CellFormatShorthand
Converts to this type from the input type.
source§impl From<UnknownFormat> for BoolFormat
impl From<UnknownFormat> for BoolFormat
source§fn from(unknown_format: UnknownFormat) -> Self
fn from(unknown_format: UnknownFormat) -> Self
Converts to this type from the input type.
source§impl TryInto<BoolFormat> for CellFormat
impl TryInto<BoolFormat> for CellFormat
§type Error = FormatError
type Error = FormatError
The type returned in the event of a conversion error.
source§fn try_into(self) -> Result<BoolFormat, FormatError>
fn try_into(self) -> Result<BoolFormat, FormatError>
Performs the conversion.
Auto Trait Implementations§
impl RefUnwindSafe for BoolFormat
impl Send for BoolFormat
impl Sync for BoolFormat
impl Unpin for BoolFormat
impl UnwindSafe for BoolFormat
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