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 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 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
Source§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 Freeze for BinaryFormat
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
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