#[non_exhaustive]#[repr(C)]pub enum NumberBits {
Integer {
bits: usize,
sign: Signedness,
},
Float {
sign_bits: usize,
exponent_bits: usize,
mantissa_bits: usize,
has_explicit_first_mantissa_bit: bool,
},
Fixed {
sign_bits: usize,
integer_bits: usize,
fraction_bits: usize,
},
Decimal {
sign_bits: usize,
integer_bits: usize,
scale_bits: usize,
},
}Expand description
Bit representation of numbers
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.
Integer
Integer number limits with specified number of bits
Fields
§
sign: SignednessWhether the integer is signed or unsigned
Float
Floating-point number limits with specified sign, exponent and mantissa bits
Fields
§
has_explicit_first_mantissa_bit: boolFloating-point numbers that are large enough to not be “in subnormal mode” have their mantissa represent a number between 1 (included) and 2 (excluded) This indicates whether the representation of the mantissa has the significant digit (always 1) explicitly written out
Fixed
Fixed-point number limits with specified integer and fractional bits
Fields
Decimal
Decimal number limits with unsized-integer, scaling, and sign bits
Trait Implementations§
Source§impl Clone for NumberBits
impl Clone for NumberBits
Source§fn clone(&self) -> NumberBits
fn clone(&self) -> NumberBits
Returns a copy 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 NumberBits
impl Debug for NumberBits
Source§impl Hash for NumberBits
impl Hash for NumberBits
Source§impl PartialEq for NumberBits
impl PartialEq for NumberBits
impl Copy for NumberBits
impl Eq for NumberBits
impl StructuralPartialEq for NumberBits
Auto Trait Implementations§
impl Freeze for NumberBits
impl RefUnwindSafe for NumberBits
impl Send for NumberBits
impl Sync for NumberBits
impl Unpin for NumberBits
impl UnwindSafe for NumberBits
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