Trait num_bytes::IntoBytes[][src]

pub trait IntoBytes: Sized {
    fn into_le_bytes(self) -> Vec<u8>;
fn into_be_bytes(self) -> Vec<u8>; }
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]);

Required methods

Implementations on Foreign Types

Implementors