[][src]Struct heed_types::integer::I64

#[repr(transparent)]pub struct I64<O: ByteOrder>(_, _);

A 64-bit signed integer stored in O byte order.

I64 is like the native i64 type with two major differences: First, it has no alignment requirement (its alignment is 1). Second, the endianness of its memory layout is given by the type parameter O.

An I64 can be constructed using the new method, and its contained value can be obtained as a native i64 using the get method, or updated in place with the set method. In all cases, if the endianness O is not the same as the endianness of the current platform, an endianness swap will be performed in order to uphold the invariants that a) the layout of I64 has endianness O and that, b) the layout of i64 has the platform's native endianness.

I64 implements Zeroable, and Pod, making it useful for parsing and serialization.

Implementations

impl<O: ByteOrder> I64<O>[src]

pub fn new(n: i64) -> I64<O>[src]

Constructs a new value, possibly performing an endianness swap to guarantee that the returned value has endianness O.

pub fn get(self) -> i64[src]

Returns the value as a primitive type, possibly performing an endianness swap to guarantee that the return value has the endianness of the native platform.

pub fn set(&mut self, n: i64)[src]

Updates the value in place as a primitive type, possibly performing an endianness swap to guarantee that the stored value has the endianness O.

Trait Implementations

impl<O: ByteOrder> AsMut<[u8; 8]> for I64<O>[src]

impl<O: ByteOrder> AsRef<[u8; 8]> for I64<O>[src]

impl<O: ByteOrder> Binary for I64<O>[src]

impl<O: Clone + ByteOrder> Clone for I64<O>[src]

impl<O: Copy + ByteOrder> Copy for I64<O>[src]

impl<O: ByteOrder> Debug for I64<O>[src]

impl<O: Default + ByteOrder> Default for I64<O>[src]

impl<O: ByteOrder> Display for I64<O>[src]

impl<O: Eq + ByteOrder> Eq for I64<O>[src]

impl<O: ByteOrder> From<[u8; 8]> for I64<O>[src]

impl<O: Hash + ByteOrder> Hash for I64<O>[src]

impl<O: ByteOrder> LowerHex for I64<O>[src]

impl<O: ByteOrder> Octal for I64<O>[src]

impl<O: ByteOrder> PartialEq<[u8; 8]> for I64<O>[src]

impl<O: PartialEq + ByteOrder> PartialEq<I64<O>> for I64<O>[src]

impl<O: 'static + ByteOrder> Pod for I64<O>[src]

impl<O: ByteOrder> StructuralEq for I64<O>[src]

impl<O: ByteOrder> StructuralPartialEq for I64<O>[src]

impl<O: ByteOrder> UpperHex for I64<O>[src]

impl<O: ByteOrder> Zeroable for I64<O>[src]

Auto Trait Implementations

impl<O> RefUnwindSafe for I64<O> where
    O: RefUnwindSafe
[src]

impl<O> Send for I64<O> where
    O: Send
[src]

impl<O> Sync for I64<O> where
    O: Sync
[src]

impl<O> Unpin for I64<O> where
    O: Unpin
[src]

impl<O> UnwindSafe for I64<O> where
    O: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.