Trait num_bytes::IntoBytes[][src]

pub trait IntoBytes<const T: usize>: Sized {
    fn into_le_bytes(self) -> [u8; T];
fn into_be_bytes(self) -> [u8; T]; }
Expand description

Defines a type can be converted into a byte vector.

use num_bytes::IntoBytes;
let a = 8u32;
let b = a.into_le_bytes();
assert_eq!(b,[8,0,0,0]);

isize and usize implementations compile to implement FromBytes<2>, FromBytes<4> or FromBytes<8> depending on your system.

It simply says FromBytes<8> in documentation because the machine which has compiled the documentation is 64 bit.

Required methods

Implementations on Foreign Types

Implementors