pub struct FormatUtils;
Expand description
Format utilities
Implementations§
Source§impl FormatUtils
impl FormatUtils
Sourcepub fn format_bytes(bytes: u64) -> String
pub fn format_bytes(bytes: u64) -> String
Format bytes as human readable size
Sourcepub fn format_speed(bytes_per_sec: u64) -> String
pub fn format_speed(bytes_per_sec: u64) -> String
Format speed in bytes/sec
Sourcepub fn format_duration(duration: Duration) -> String
pub fn format_duration(duration: Duration) -> String
Format duration as human readable
Sourcepub fn format_percentage(value: f64) -> String
pub fn format_percentage(value: f64) -> String
Format percentage
Sourcepub fn truncate_digest(digest: &str, len: usize) -> String
pub fn truncate_digest(digest: &str, len: usize) -> String
Truncate digest for display
Auto Trait Implementations§
impl Freeze for FormatUtils
impl RefUnwindSafe for FormatUtils
impl Send for FormatUtils
impl Sync for FormatUtils
impl Unpin for FormatUtils
impl UnwindSafe for FormatUtils
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