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