pub trait Float: Float + Sealed + Debug {
    type Bytes: AsRef<[u8]> + AsMut<[u8]> + Default;

    // Required methods
    fn from_le_bytes(bytes: Self::Bytes) -> Self;
    fn to_le_bytes(&self) -> Self::Bytes;
}
Expand description

Sealead trait to generically represent f32 and f64.

Required Associated Types§

Required Methods§

source

fn from_le_bytes(bytes: Self::Bytes) -> Self

source

fn to_le_bytes(&self) -> Self::Bytes

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Float for f32

§

type Bytes = [u8; 4]

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

impl Float for f64

§

type Bytes = [u8; 8]

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn to_le_bytes(&self) -> Self::Bytes

Implementors§