Struct format_struct::I64
source · #[repr(C)]pub struct I64<E>(/* private fields */);
Expand description
A type that wraps a byte array to be decoded into a i64
.
The generic parameter represents the endianness used to decode the wrapped value. In
case the value is expected to have fixed endianness, either BigEndian
or
LittleEndian
types should be used, otherwise the Endian
type.
Implementations§
source§impl<E> I64<E>
impl<E> I64<E>
sourcepub const fn from_bytes(bytes: [u8; 8]) -> Self
pub const fn from_bytes(bytes: [u8; 8]) -> Self
Converts a byte array into a I64
.
source§impl<E> I64<E>
impl<E> I64<E>
sourcepub const fn slice_as_byte_slice(slice: &[Self]) -> &[u8]
pub const fn slice_as_byte_slice(slice: &[Self]) -> &[u8]
Converts an immutable slice of I64
into an immutable byte slice.
sourcepub fn slice_as_byte_slice_mut(slice: &mut [Self]) -> &mut [u8]
pub fn slice_as_byte_slice_mut(slice: &mut [Self]) -> &mut [u8]
Converts a mutable slice of I64
into a mutable byte slice.
source§impl I64<Endian>
impl I64<Endian>
sourcepub const fn new_with_endian(value: i64, endian: Endian) -> Self
pub const fn new_with_endian(value: i64, endian: Endian) -> Self
Constructs a I64
wrapper type from a i64
value using the specified endianness.
sourcepub const fn get_with_endian(self, endian: Endian) -> i64
pub const fn get_with_endian(self, endian: Endian) -> i64
Extracts a i64
value from a I64
wrapper using the specified endianness.
Trait Implementations§
source§impl<E> FromByteSlice for I64<E>
impl<E> FromByteSlice for I64<E>
source§fn from_byte_slice(s: &[u8]) -> Result<&Self, InvalidSizeError>
fn from_byte_slice(s: &[u8]) -> Result<&Self, InvalidSizeError>
Transmutes an immutable byte slice reference into an immutable
Self
reference. Read moresource§fn from_byte_slice_mut(s: &mut [u8]) -> Result<&mut Self, InvalidSizeError>
fn from_byte_slice_mut(s: &mut [u8]) -> Result<&mut Self, InvalidSizeError>
Transmutes a mutable byte slice reference into a mutable
Self
reference. Read moresource§fn slice_from_byte_slice(s: &[u8]) -> Result<&[Self], InvalidSizeError>
fn slice_from_byte_slice(s: &[u8]) -> Result<&[Self], InvalidSizeError>
Transmutes an immutable byte slice reference into an immutable to a slice of
Self
. Read moresource§fn slice_from_byte_slice_mut(
s: &mut [u8]
) -> Result<&mut [Self], InvalidSizeError>
fn slice_from_byte_slice_mut( s: &mut [u8] ) -> Result<&mut [Self], InvalidSizeError>
Transmutes a mutable byte slice reference into a mutable to a slice of
Self
. Read moresource§impl<E: PartialEq> PartialEq for I64<E>
impl<E: PartialEq> PartialEq for I64<E>
impl<E: Copy> Copy for I64<E>
impl<E: Eq> Eq for I64<E>
impl<E> StructuralPartialEq for I64<E>
Auto Trait Implementations§
impl<E> Freeze for I64<E>
impl<E> RefUnwindSafe for I64<E>where
E: RefUnwindSafe,
impl<E> Send for I64<E>where
E: Send,
impl<E> Sync for I64<E>where
E: Sync,
impl<E> Unpin for I64<E>where
E: Unpin,
impl<E> UnwindSafe for I64<E>where
E: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more