pub struct SizeFormatter<T: ToF64 + Unsigned, O: AsRef<FormatSizeOptions>> { /* private fields */ }
Implementations§
Source§impl<V: ToF64 + Unsigned, O: AsRef<FormatSizeOptions>> SizeFormatter<V, O>
impl<V: ToF64 + Unsigned, O: AsRef<FormatSizeOptions>> SizeFormatter<V, O>
Sourcepub fn new(value: V, options: O) -> Self
pub fn new(value: V, options: O) -> Self
Examples found in repository?
examples/sizes.rs (line 14)
5 6 7 8 9 10 11 12 13 14 15 16
fn main() {
println!("{}", format_size(5456usize, BINARY));
println!("{}", format_size(1024usize, DECIMAL));
println!("{}", format_size(1000usize, WINDOWS));
println!("{}", format_size(1_023_654_123_654_u64, BINARY));
println!("{}", format_size(123456789usize, DECIMAL));
println!("{}", format_size_i(-123456789, WINDOWS));
println!("{}", SizeFormatter::new(1234u32, BINARY));
println!("{}", ISizeFormatter::new(1234, BINARY));
}
Trait Implementations§
Source§impl<T: ToF64 + Unsigned + Copy, O: AsRef<FormatSizeOptions> + Copy> Display for SizeFormatter<T, O>
impl<T: ToF64 + Unsigned + Copy, O: AsRef<FormatSizeOptions> + Copy> Display for SizeFormatter<T, O>
Source§impl<'a, U: ToF64 + Unsigned + Copy, O: AsRef<FormatSizeOptions>> From<&'a SizeFormatter<U, O>> for ISizeFormatter<U, &'a O>
impl<'a, U: ToF64 + Unsigned + Copy, O: AsRef<FormatSizeOptions>> From<&'a SizeFormatter<U, O>> for ISizeFormatter<U, &'a O>
Source§fn from(source: &'a SizeFormatter<U, O>) -> Self
fn from(source: &'a SizeFormatter<U, O>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T, O> Freeze for SizeFormatter<T, O>
impl<T, O> RefUnwindSafe for SizeFormatter<T, O>where
T: RefUnwindSafe,
O: RefUnwindSafe,
impl<T, O> Send for SizeFormatter<T, O>
impl<T, O> Sync for SizeFormatter<T, O>
impl<T, O> Unpin for SizeFormatter<T, O>
impl<T, O> UnwindSafe for SizeFormatter<T, O>where
T: UnwindSafe,
O: UnwindSafe,
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