Struct sanakirja::L64

source ·
pub struct L64(pub u64);
Expand description

A 64-bit unsigned integer in little-endian ordering.

Tuple Fields§

§0: u64

Implementations§

source§

impl L64

source

pub fn as_u64(&self) -> u64

Convert to machine 64-bit integers

source

pub fn as_usize(&self) -> usize

Convert to usize

source§

impl L64

source

pub fn from_slice_le(s: &[u8]) -> Self

Read an L64 from its binary representation.

source

pub fn to_slice_le(&self, s: &mut [u8])

Write an L64 as its binary representation.

Trait Implementations§

source§

impl Add<usize> for L64

§

type Output = L64

The resulting type after applying the + operator.
source§

fn add(self, x: usize) -> L64

Performs the + operation. Read more
source§

impl Add for L64

§

type Output = L64

The resulting type after applying the + operator.
source§

fn add(self, x: L64) -> L64

Performs the + operation. Read more
source§

impl Clone for L64

source§

fn clone(&self) -> L64

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for L64

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for L64

source§

fn deserialize<D>(deserializer: D) -> Result<L64, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for L64

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<L64> for u64

source§

fn from(u: L64) -> Self

Converts to this type from the input type.
source§

impl From<L64> for usize

source§

fn from(u: L64) -> Self

Converts to this type from the input type.
source§

impl From<u64> for L64

source§

fn from(u: u64) -> Self

Converts to this type from the input type.
source§

impl From<usize> for L64

source§

fn from(u: usize) -> Self

Converts to this type from the input type.
source§

impl Hash for L64

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for L64

source§

fn cmp(&self, x: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for L64

source§

fn eq(&self, other: &L64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for L64

source§

fn partial_cmp(&self, x: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for L64

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Storable for L64

§

type PageReferences = Empty<u64>

An iterator over the offsets to pages contained in this value. Only values from this crate can generate non-empty iterators, but combined values (like tuples) must chain the iterators returned by method page_offsets.
source§

fn page_references(&self) -> Self::PageReferences

If this value is an offset to another page at offset offset, return Some(offset). Return None else.
source§

fn compare<T>(&self, _: &T, b: &Self) -> Ordering

This is required for B trees, not necessarily for other structures. The default implementation panics.
source§

unsafe fn drop<T>(&self, txn: &mut T) -> Result<(), <T as LoadPage>::Error>
where T: AllocPage,

If this value is an offset to another page at offset offset, return Some(offset). Return None else. Read more
source§

impl SubAssign<usize> for L64

source§

fn sub_assign(&mut self, x: usize)

Performs the -= operation. Read more
source§

impl UnsizedStorable for L64

source§

fn size(&self) -> usize

If Self::SIZE.is_some(), this must return the same value. The default implementation is Self;:SIZE.unwrap().

source§

unsafe fn onpage_size(_: *const u8) -> usize

Read the size from an on-page entry.

source§

const ALIGN: usize = 8usize

source§

unsafe fn write_to_page(&self, p: *mut u8)

Write to a page. Must not overwrite the allocated size, but this isn’t checked (which is why it’s unsafe).
source§

unsafe fn from_raw_ptr<'a, T>(_: &T, p: *const u8) -> &'a Self

source§

unsafe fn write_to_page_alloc<T>(&self, _: &mut T, p: *mut u8)
where T: AllocPage,

Write to a page. Must not overwrite the allocated size, but this isn’t checked (which is why it’s unsafe). Read more
source§

impl Copy for L64

source§

impl Eq for L64

source§

impl StructuralPartialEq for L64

Auto Trait Implementations§

§

impl RefUnwindSafe for L64

§

impl Send for L64

§

impl Sync for L64

§

impl Unpin for L64

§

impl UnwindSafe for L64

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,