Trait FromBytes
trait FromBytes: Sized
Associated Types
type Bytes: TraitBound { trait_: Path { path: "NumBytes", id: Id(1880), args: None }, generic_params: [], modifier: None } + TraitBound { trait_: Path { path: "Sized", id: Id(378), args: None }, generic_params: [], modifier: Maybe }
Required Methods
fn from_be_bytes(bytes: &<Self as >::Bytes) -> SelfCreate a number from its representation as a byte array in big endian.
Examples
use FromBytes; let value: u32 = from_be_bytes; assert_eq!;fn from_le_bytes(bytes: &<Self as >::Bytes) -> SelfCreate a number from its representation as a byte array in little endian.
Examples
use FromBytes; let value: u32 = from_le_bytes; assert_eq!;
Provided Methods
fn from_ne_bytes(bytes: &<Self as >::Bytes) -> SelfCreate a number from its memory representation as a byte array in native endianness.
As the target platform's native endianness is used, portable code likely wants to use
from_be_bytesorfrom_le_bytes, as appropriate instead.Examples
use FromBytes; let bytes = ; let bytes = ; let value: u32 = from_ne_bytes; assert_eq!
Implementors
impl FromBytes for u16impl FromBytes for u32impl FromBytes for u64impl FromBytes for u128impl FromBytes for usizeimpl FromBytes for i8impl FromBytes for i16impl FromBytes for i32impl FromBytes for i64impl FromBytes for i128impl FromBytes for isizeimpl FromBytes for f32impl FromBytes for f64impl FromBytes for u8