Trait ToBytes
trait ToBytes
Associated Types
type Bytes: TraitBound { trait_: Path { path: "NumBytes", id: Id(1880), args: None }, generic_params: [], modifier: None }
Required Methods
fn to_be_bytes(self: &Self) -> <Self as >::BytesReturn the memory representation of this number as a byte array in big-endian byte order.
Examples
use ToBytes; let bytes = to_be_bytes; assert_eq!;fn to_le_bytes(self: &Self) -> <Self as >::BytesReturn the memory representation of this number as a byte array in little-endian byte order.
Examples
use ToBytes; let bytes = to_le_bytes; assert_eq!;
Provided Methods
fn to_ne_bytes(self: &Self) -> <Self as >::BytesReturn the memory representation of this number as a byte array in native byte order.
As the target platform's native endianness is used, portable code should use
to_be_bytesorto_le_bytes, as appropriate, instead.Examples
use ToBytes; let expected = ; let expected = ; let bytes = to_ne_bytes; assert_eq!
Implementors
impl ToBytes for u8impl ToBytes for u16impl ToBytes for u32impl ToBytes for u64impl ToBytes for u128impl ToBytes for usizeimpl ToBytes for i8impl ToBytes for i16impl ToBytes for i32impl ToBytes for i64impl ToBytes for i128impl ToBytes for isizeimpl ToBytes for f32impl ToBytes for f64