Struct etop_format::string_format::StringFormat
source · pub struct StringFormat {
pub min_width: usize,
pub max_width: usize,
pub align: StringAlign,
pub fill_char: char,
}Expand description
string format specification
Fields§
§min_width: usizemin_width of string, for padding
max_width: usizemax_width of string, for padding
align: StringAlignalign string to left or right
fill_char: charfill padding char
Implementations§
source§impl StringFormat
impl StringFormat
sourcepub fn new() -> StringFormat
pub fn new() -> StringFormat
create new number format
sourcepub fn width(self, width: usize) -> StringFormat
pub fn width(self, width: usize) -> StringFormat
set width
sourcepub fn min_width(self, min_width: usize) -> StringFormat
pub fn min_width(self, min_width: usize) -> StringFormat
set min_width
sourcepub fn max_width(self, max_width: usize) -> StringFormat
pub fn max_width(self, max_width: usize) -> StringFormat
set max_width
sourcepub fn width_option(self, width: Option<usize>) -> StringFormat
pub fn width_option(self, width: Option<usize>) -> StringFormat
set width
sourcepub fn min_width_option(self, width: Option<usize>) -> StringFormat
pub fn min_width_option(self, width: Option<usize>) -> StringFormat
set min_width
sourcepub fn max_width_option(self, width: Option<usize>) -> StringFormat
pub fn max_width_option(self, width: Option<usize>) -> StringFormat
set max_width
sourcepub fn left_align(self) -> StringFormat
pub fn left_align(self) -> StringFormat
left align
sourcepub fn right_align(self) -> StringFormat
pub fn right_align(self) -> StringFormat
right align
sourcepub fn fill_char(self, fill_char: char) -> StringFormat
pub fn fill_char(self, fill_char: char) -> StringFormat
add fill char
source§impl StringFormat
impl StringFormat
Trait Implementations§
source§impl Clone for StringFormat
impl Clone for StringFormat
source§fn clone(&self) -> StringFormat
fn clone(&self) -> StringFormat
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 StringFormat
impl Debug for StringFormat
source§impl Default for StringFormat
impl Default for StringFormat
source§fn default() -> StringFormat
fn default() -> StringFormat
Returns the “default value” for a type. Read more
source§impl From<StringFormat> for CellFormatShorthand
impl From<StringFormat> for CellFormatShorthand
source§fn from(format: StringFormat) -> CellFormatShorthand
fn from(format: StringFormat) -> CellFormatShorthand
Converts to this type from the input type.
source§impl From<UnknownFormat> for StringFormat
impl From<UnknownFormat> for StringFormat
source§fn from(unknown_format: UnknownFormat) -> Self
fn from(unknown_format: UnknownFormat) -> Self
Converts to this type from the input type.
source§impl TryInto<StringFormat> for CellFormat
impl TryInto<StringFormat> for CellFormat
§type Error = FormatError
type Error = FormatError
The type returned in the event of a conversion error.
source§fn try_into(self) -> Result<StringFormat, FormatError>
fn try_into(self) -> Result<StringFormat, FormatError>
Performs the conversion.
Auto Trait Implementations§
impl RefUnwindSafe for StringFormat
impl Send for StringFormat
impl Sync for StringFormat
impl Unpin for StringFormat
impl UnwindSafe for StringFormat
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