pub struct SizeFormatConfig {
pub precision: usize,
pub use_full_names: bool,
pub use_plural: bool,
pub use_binary_prefix: bool,
pub min_unit: SizeUnit,
pub max_unit: SizeUnit,
pub separator: String,
pub show_exact_bytes: bool,
}Expand description
Configuration for size formatting
Fields§
§precision: usize§use_full_names: bool§use_plural: bool§use_binary_prefix: bool§min_unit: SizeUnit§max_unit: SizeUnit§separator: String§show_exact_bytes: boolImplementations§
Source§impl SizeFormatConfig
impl SizeFormatConfig
Sourcepub fn precision(self, precision: usize) -> Self
pub fn precision(self, precision: usize) -> Self
Sets the decimal precision for formatted output
Sourcepub fn full_names(self) -> Self
pub fn full_names(self) -> Self
Use full unit names instead of abbreviations
Sourcepub fn decimal_prefix(self) -> Self
pub fn decimal_prefix(self) -> Self
Use decimal (1000) instead of binary (1024) prefixes
Sourcepub fn show_exact_bytes(self) -> Self
pub fn show_exact_bytes(self) -> Self
Show exact byte count in parentheses for large sizes
Trait Implementations§
Source§impl Clone for SizeFormatConfig
impl Clone for SizeFormatConfig
Source§fn clone(&self) -> SizeFormatConfig
fn clone(&self) -> SizeFormatConfig
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 SizeFormatConfig
impl Debug for SizeFormatConfig
Auto Trait Implementations§
impl Freeze for SizeFormatConfig
impl RefUnwindSafe for SizeFormatConfig
impl Send for SizeFormatConfig
impl Sync for SizeFormatConfig
impl Unpin for SizeFormatConfig
impl UnsafeUnpin for SizeFormatConfig
impl UnwindSafe for SizeFormatConfig
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