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 duplicate 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
Source§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 Freeze for BoolFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more