pub struct I64(/* private fields */);Expand description
A signed, 64-bit integer type with explicit alignment requirements
Without the explicit align representation hint, this type may have different
alignment requirements on different machines. This helps to ensure that the type
has a predictable layout in memory and that operations assuming a particular
alignment value are sound.
Implementations§
Source§impl I64
impl I64
Sourcepub const fn new_le(value: i64) -> Self
pub const fn new_le(value: i64) -> Self
Creates a new I64 from an integer, interpreting it
as little endian byte order
Sourcepub const fn from_le_chunk(chunk: Chunk<8>) -> Self
pub const fn from_le_chunk(chunk: Chunk<8>) -> Self
Reads a new I64 in little endian byte order
from a chunk of bytes with size 8
Sourcepub const fn from_be_chunk(chunk: Chunk<8>) -> Self
pub const fn from_be_chunk(chunk: Chunk<8>) -> Self
Reads a new I64 in big endian byte order
from a chunk of bytes with size 8
Sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> Self
pub const fn from_le_bytes(bytes: [u8; 8]) -> Self
Create a native endian integer value from its representation as a byte array in little endian.
Sourcepub const fn from_be_bytes(bytes: [u8; 8]) -> Self
pub const fn from_be_bytes(bytes: [u8; 8]) -> Self
Create a native endian integer value from its representation as a byte array in big endian.
Sourcepub const fn to_le_bytes(self) -> [u8; 8]
pub const fn to_le_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in little-endian byte order.
Sourcepub const fn to_be_bytes(self) -> [u8; 8]
pub const fn to_be_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in little-endian byte order.
Sourcepub const fn get(self, endian: Endian) -> i64
pub const fn get(self, endian: Endian) -> i64
Get the i64 aligned integer in the the specified byte order.