#[non_exhaustive]pub enum Unit {
Show 13 variants
Byte,
KiloByte,
MegaByte,
GigaByte,
TeraByte,
PetaByte,
ExaByte,
KibiByte,
MebiByte,
GibiByte,
TebiByte,
PebiByte,
ExbiByte,
}Expand description
Scale unit.
use bytesize::Unit;
assert_eq!(
"GiB".parse::<Unit>().unwrap(),
Unit::GibiByte,
);
"gibibyte".parse::<Unit>().unwrap_err();Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Byte
Single byte.
KiloByte
Kilobyte (10^3 bytes).
MegaByte
Megabyte (10^6 bytes)
GigaByte
Gigabyte (10^9 bytes)
TeraByte
Terabyte (10^12 bytes)
PetaByte
Petabyte (10^15 bytes)
ExaByte
Exabyte (10^18 bytes)
KibiByte
Kibibyte (2^10 bytes)
MebiByte
Mebibyte (2^20 bytes)
GibiByte
Gibibyte (2^30 bytes)
TebiByte
Tebibyte (2^40 bytes)
PebiByte
Pebibyte (2^50 bytes)
ExbiByte
Exbibyte (2^60 bytes)
Trait Implementations§
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
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