[][src]Struct bigbit::headbyte::HBNum

pub struct HBNum { /* fields omitted */ }

The Head Byte format, capable of storing integers and decimal fractions up to ±1.34078079e+281.

See the module-level documentation for more.

Implementations

impl HBNum[src]

pub fn from_raw_parts(
    hb: HeadByte,
    exponent: Option<Exponent>,
    coefficients: Vec<u8>
) -> Self
[src]

Constructs a new HBNum from the head byte, exponent and the coefficients.

The length of the coefficient storage and the presence of the exponent override the value in the head byte. If the head byte cannot fit the total number of bytes, this call panics.

pub const fn headbyte(&self) -> HeadByte[src]

Returns the head byte.

The results of inspecting the head byte are reliable and always match the properties of the actual value of the entire number. For example, if has_exponent on the head byte always returns true, there always is an exponent byte to retreieve.

pub const fn exponent(&self) -> Option<Exponent>[src]

Returns the exponent, or None if it's not used (mainly the case for integers).

pub fn coefficient_le_iter(
    &self
) -> impl Iterator<Item = u8> + DoubleEndedIterator + '_
[src]

Returns an iterator over the coefficients in little endian byte order.

pub fn coefficient_be_iter(
    &self
) -> impl Iterator<Item = u8> + DoubleEndedIterator + '_
[src]

Returns an iterator over the coefficients in big endian byte order.

Trait Implementations

impl Clone for HBNum[src]

Auto Trait Implementations

impl RefUnwindSafe for HBNum

impl Send for HBNum

impl Sync for HBNum

impl Unpin for HBNum

impl UnwindSafe for HBNum

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.