pub struct Unit(/* private fields */);Implementations§
Source§impl Unit
impl Unit
pub const MIN: Unit
pub const MAX: Unit
pub const fn prefix(&self) -> Option<UnitPrefix>
pub const fn size_variant(&self) -> SizeVariant
pub const fn is_decimal(&self) -> bool
pub const fn is_binary(&self) -> bool
pub const fn is_prefixed(&self) -> bool
pub const fn is_bit(&self) -> bool
pub const fn is_byte(&self) -> bool
pub const fn index(&self) -> usize
pub const fn decimal(&self) -> Self
pub const fn binary(&self) -> Self
pub const fn bit(&self) -> Self
pub const fn byte(&self) -> Self
pub const fn effective_value(&self) -> Int
pub const fn mode(&self) -> Mode
pub const fn symbols(&self) -> (&'static str, &'static str)
pub fn symbol(&self) -> String
pub const fn symbols_long( &self, plural: bool, multi_caps: bool, ) -> (&'static str, &'static str)
pub fn symbol_long(&self, plural: bool, multi_caps: bool) -> String
pub const fn symbol_condensed(&self) -> &'static str
pub const fn symbols_initials(&self) -> (&'static str, &'static str)
pub fn symbol_initials(&self) -> String
Trait Implementations§
Source§impl From<(UnitPrefix, SizeVariant)> for Unit
impl From<(UnitPrefix, SizeVariant)> for Unit
Source§fn from((prefix, variant): (UnitPrefix, SizeVariant)) -> Self
fn from((prefix, variant): (UnitPrefix, SizeVariant)) -> Self
Converts to this type from the input type.
Source§impl From<SizeVariant> for Unit
impl From<SizeVariant> for Unit
Source§fn from(variant: SizeVariant) -> Self
fn from(variant: SizeVariant) -> Self
Converts to this type from the input type.
Source§impl From<UnitPrefix> for Unit
impl From<UnitPrefix> for Unit
Source§fn from(prefix: UnitPrefix) -> Self
fn from(prefix: UnitPrefix) -> Self
Converts to this type from the input type.
Source§impl Ord for Unit
impl Ord for Unit
Source§impl PartialOrd for Unit
impl PartialOrd for Unit
impl Copy for Unit
impl Eq for Unit
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