Struct U64x2

Source
pub struct U64x2(/* private fields */);
Expand description

[u64; 2] as a vector.

Implementations§

Source§

impl U64x2

Source

pub const fn from_array(arr: [u64; 2]) -> Self

Create a vector from an array.

Unlike the From trait function, the from_array function is const.

§Example
const MY_EXTREMELY_FUN_VALUE: U64x2 = U64x2::from_array([0, 1]);
for (i, value) in MY_EXTREMELY_FUN_VALUE.as_array().iter().copied().enumerate() {
    assert_eq!(i as u64, value);
}
Source§

impl U64x2

Source

pub fn carryless_mul<const HI_OTHER: bool, const HI_SELF: bool>( &self, other: U64x2, ) -> U64x2

§Scalar Equivalent:
 let x = if HI_SELF { self.as_array()[1] } else { self.as_array()[0] };
 let y = if HI_OTHER { other.as_array()[1] } else { other.as_array()[0] };
// This software carryless-multplication implementation is from https://github.com/RustCrypto/universal-hashes/blob/2e8a948dbb25bc2ac6c712b4bdc21b158527ca70/polyval/src/backend/soft64.rs
// That code is MIT/Apache dual-licensed.
#[inline(always)]
fn bmul64(x: u64, y: u64) -> u64 {
    use std::num::Wrapping;
    let x0 = Wrapping(x & 0x1111_1111_1111_1111);
    let x1 = Wrapping(x & 0x2222_2222_2222_2222);
    let x2 = Wrapping(x & 0x4444_4444_4444_4444);
    let x3 = Wrapping(x & 0x8888_8888_8888_8888);
    let y0 = Wrapping(y & 0x1111_1111_1111_1111);
    let y1 = Wrapping(y & 0x2222_2222_2222_2222);
    let y2 = Wrapping(y & 0x4444_4444_4444_4444);
    let y3 = Wrapping(y & 0x8888_8888_8888_8888);
    let mut z0 = ((x0 * y0) ^ (x1 * y3) ^ (x2 * y2) ^ (x3 * y1)).0;
    let mut z1 = ((x0 * y1) ^ (x1 * y0) ^ (x2 * y3) ^ (x3 * y2)).0;
    let mut z2 = ((x0 * y2) ^ (x1 * y1) ^ (x2 * y0) ^ (x3 * y3)).0;
    let mut z3 = ((x0 * y3) ^ (x1 * y2) ^ (x2 * y1) ^ (x3 * y0)).0;
    z0 &= 0x1111_1111_1111_1111;
    z1 &= 0x2222_2222_2222_2222;
    z2 &= 0x4444_4444_4444_4444;
    z3 &= 0x8888_8888_8888_8888;
    z0 | z1 | z2 | z3
}
#[inline(always)]
fn rev64(mut x: u64) -> u64 {
    x = ((x & 0x5555_5555_5555_5555) << 1) | ((x >> 1) & 0x5555_5555_5555_5555);
    x = ((x & 0x3333_3333_3333_3333) << 2) | ((x >> 2) & 0x3333_3333_3333_3333);
    x = ((x & 0x0f0f_0f0f_0f0f_0f0f) << 4) | ((x >> 4) & 0x0f0f_0f0f_0f0f_0f0f);
    x = ((x & 0x00ff_00ff_00ff_00ff) << 8) | ((x >> 8) & 0x00ff_00ff_00ff_00ff);
    x = ((x & 0xffff_0000_ffff) << 16) | ((x >> 16) & 0xffff_0000_ffff);
    x.rotate_right(32)
}
U64x2::from([
    bmul64(x, y),
    rev64(bmul64(rev64(x), rev64(y))) >> 1,
])
§Avx2

Trait Implementations§

Source§

impl Add for U64x2

Source§

fn add(self, rhs: U64x2) -> U64x2

Perform a pairwise wrapping_add

§Scalar Equivalent
U64x2::from([
    self.as_array()[0].wrapping_add(rhs.as_array()[0]),
    self.as_array()[1].wrapping_add(rhs.as_array()[1]),
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = U64x2

The resulting type after applying the + operator.
Source§

impl AddAssign for U64x2

Source§

fn add_assign(&mut self, other: U64x2)

Performs the += operation. Read more
Source§

impl AsMut<[u64]> for U64x2

Source§

fn as_mut(&mut self) -> &mut [u64]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<[u64]> for U64x2

Source§

fn as_ref(&self) -> &[u64]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl BitAnd for U64x2

Source§

fn bitand(self, rhs: U64x2) -> U64x2

Perform a pairwise bitwise and

§Scalar Equivalent
U64x2::from([
    self.as_array()[0] & rhs.as_array()[0],
    self.as_array()[1] & rhs.as_array()[1],
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = U64x2

The resulting type after applying the & operator.
Source§

impl BitAndAssign for U64x2

Source§

fn bitand_assign(&mut self, other: U64x2)

Performs the &= operation. Read more
Source§

impl BitOr for U64x2

Source§

fn bitor(self, rhs: U64x2) -> U64x2

Perform a pairwise bitwise or

§Scalar Equivalent
U64x2::from([
    self.as_array()[0] | rhs.as_array()[0],
    self.as_array()[1] | rhs.as_array()[1],
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = U64x2

The resulting type after applying the | operator.
Source§

impl BitOrAssign for U64x2

Source§

fn bitor_assign(&mut self, other: U64x2)

Performs the |= operation. Read more
Source§

impl BitXor for U64x2

Source§

fn bitxor(self, rhs: U64x2) -> U64x2

Perform a pairwise bitwise xor

§Scalar Equivalent
U64x2::from([
    self.as_array()[0] ^ rhs.as_array()[0],
    self.as_array()[1] ^ rhs.as_array()[1],
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = U64x2

The resulting type after applying the ^ operator.
Source§

impl BitXorAssign for U64x2

Source§

fn bitxor_assign(&mut self, other: U64x2)

Performs the ^= operation. Read more
Source§

impl Clone for U64x2

Source§

fn clone(&self) -> U64x2

Returns a duplicate 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 ConditionallySelectable for U64x2

Source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
Source§

impl ConstantTimeEq for U64x2

Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl Debug for U64x2

Source§

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

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

impl Default for U64x2

Source§

fn default() -> Self

The zero vector.

Source§

impl<'de> Deserialize<'de> for U64x2

Source§

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

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

impl Distribution<U64x2> for Standard

Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> U64x2

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
Source§

impl ExtendingCast<U16x8> for U64x2

Source§

fn extending_cast_from(vector: U16x8) -> U64x2

§Scalar Equivalent:
U64x2::from([
        u64::from(vector.as_array()[0]),
        u64::from(vector.as_array()[1]),
])
§Avx2
Source§

impl ExtendingCast<U32x4> for U64x2

Source§

fn extending_cast_from(vector: U32x4) -> U64x2

§Scalar Equivalent:
U64x2::from([
        u64::from(vector.as_array()[0]),
        u64::from(vector.as_array()[1]),
])
§Avx2
Source§

impl ExtendingCast<U8x16> for U64x2

Source§

fn extending_cast_from(vector: U8x16) -> U64x2

§Scalar Equivalent:
U64x2::from([
        u64::from(vector.as_array()[0]),
        u64::from(vector.as_array()[1]),
])
§Avx2
Source§

impl From<[u64; 2]> for U64x2

Source§

fn from(arr: [u64; 2]) -> U64x2

Converts to this type from the input type.
Source§

impl From<I16x8> for U64x2

Source§

fn from(x: I16x8) -> U64x2

This cast is 100% free. It reinterprets the little-endinan bits of I16x8 as little endian bits of U64x2.

Source§

impl From<I32x4> for U64x2

Source§

fn from(x: I32x4) -> U64x2

This cast is 100% free. It reinterprets the little-endinan bits of I32x4 as little endian bits of U64x2.

Source§

impl From<I64x2> for U64x2

Source§

fn from(x: I64x2) -> U64x2

This cast is 100% free. It reinterprets the little-endinan bits of I64x2 as little endian bits of U64x2.

Source§

impl From<I8x16> for U64x2

Source§

fn from(x: I8x16) -> U64x2

This cast is 100% free. It reinterprets the little-endinan bits of I8x16 as little endian bits of U64x2.

Source§

impl From<U16x8> for U64x2

Source§

fn from(x: U16x8) -> U64x2

This cast is 100% free. It reinterprets the little-endinan bits of U16x8 as little endian bits of U64x2.

Source§

impl From<U32x4> for U64x2

Source§

fn from(x: U32x4) -> U64x2

This cast is 100% free. It reinterprets the little-endinan bits of U32x4 as little endian bits of U64x2.

Source§

impl From<U64x2> for [u64; 2]

Source§

fn from(arr: U64x2) -> [u64; 2]

Converts to this type from the input type.
Source§

impl From<U64x2> for I16x8

Source§

fn from(x: U64x2) -> I16x8

This cast is 100% free. It reinterprets the little-endinan bits of U64x2 as little endian bits of I16x8.

Source§

impl From<U64x2> for I32x4

Source§

fn from(x: U64x2) -> I32x4

This cast is 100% free. It reinterprets the little-endinan bits of U64x2 as little endian bits of I32x4.

Source§

impl From<U64x2> for I64x2

Source§

fn from(x: U64x2) -> I64x2

This cast is 100% free. It reinterprets the little-endinan bits of U64x2 as little endian bits of I64x2.

Source§

impl From<U64x2> for I8x16

Source§

fn from(x: U64x2) -> I8x16

This cast is 100% free. It reinterprets the little-endinan bits of U64x2 as little endian bits of I8x16.

Source§

impl From<U64x2> for U16x8

Source§

fn from(x: U64x2) -> U16x8

This cast is 100% free. It reinterprets the little-endinan bits of U64x2 as little endian bits of U16x8.

Source§

impl From<U64x2> for U32x4

Source§

fn from(x: U64x2) -> U32x4

This cast is 100% free. It reinterprets the little-endinan bits of U64x2 as little endian bits of U32x4.

Source§

impl From<U64x2> for U64x4

Source§

fn from(vector: U64x2) -> U64x4

NOTE: this will zero the upper bits of the destination. Other intrinsics are more effcient, but leave the upper bits undefined. At present, these more effcient intrinsics are not exposed.

§Scalar Equivalent:
let mut out = [0; 4];
out[0..2].copy_from_slice(&vector.as_array());
U64x4::from(out)
§Avx2
Source§

impl From<U64x2> for U8x16

Source§

fn from(x: U64x2) -> U8x16

This cast is 100% free. It reinterprets the little-endinan bits of U64x2 as little endian bits of U8x16.

Source§

impl From<U8x16> for U64x2

Source§

fn from(x: U8x16) -> U64x2

This cast is 100% free. It reinterprets the little-endinan bits of U8x16 as little endian bits of U64x2.

Source§

impl Hash for U64x2

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 PartialEq for U64x2

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for U64x2

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 Shl<u64> for U64x2

Source§

fn shl(self, amount: u64) -> U64x2

§Scalar Equivalent:
if amount >= 64 {
    U64x2::ZERO
} else {
    U64x2::from([
        self.as_array()[0] << amount,
        self.as_array()[1] << amount,
    ])
}
§Avx2
Source§

type Output = U64x2

The resulting type after applying the << operator.
Source§

impl Shl for U64x2

Source§

fn shl(self, amount: U64x2) -> U64x2

§Scalar Equivalent:
let mut out = self.as_array();
for (x, amm) in out.iter_mut().zip(amount.as_array().iter().copied()) {
    *x = if (0..64).contains(&amm) {
        *x << amm
    }  else {
        0
    };
}
U64x2::from(out)
§Avx2
Source§

type Output = U64x2

The resulting type after applying the << operator.
Source§

impl ShlAssign<u64> for U64x2

Source§

fn shl_assign(&mut self, amount: u64)

Performs the <<= operation. Read more
Source§

impl ShlAssign for U64x2

Source§

fn shl_assign(&mut self, amount: U64x2)

Performs the <<= operation. Read more
Source§

impl Shr<u64> for U64x2

Source§

fn shr(self, amount: u64) -> U64x2

§Scalar Equivalent:
if amount >= 64 {
    U64x2::ZERO
} else {
    U64x2::from([
        self.as_array()[0] >> amount,
        self.as_array()[1] >> amount,
    ])
}
§Avx2
Source§

type Output = U64x2

The resulting type after applying the >> operator.
Source§

impl Shr for U64x2

Source§

fn shr(self, amount: U64x2) -> U64x2

§Scalar Equivalent:
let mut out = self.as_array();
for (x, amm) in out.iter_mut().zip(amount.as_array().iter().copied()) {
    *x = if (0..64).contains(&amm) {
        *x >> amm
    }  else {
        0
    };
}
U64x2::from(out)
§Avx2
Source§

type Output = U64x2

The resulting type after applying the >> operator.
Source§

impl ShrAssign<u64> for U64x2

Source§

fn shr_assign(&mut self, amount: u64)

Performs the >>= operation. Read more
Source§

impl ShrAssign for U64x2

Source§

fn shr_assign(&mut self, amount: U64x2)

Performs the >>= operation. Read more
Source§

impl SimdBase for U64x2

Source§

fn is_zero(&self) -> bool

§Scalar Equivalent:
self.as_array().iter().all(|x| *x == 0)
§Avx2
Source§

fn set_lo(scalar: u64) -> U64x2

§Scalar Equivalent:
let mut out = [0; 2];
out[0] = scalar;
U64x2::from(out)
§Avx2
Source§

fn extract<const I: usize>(&self) -> u64

§Scalar Equivalent:
self.as_array()[I]
§Avx2
Source§

fn broadcast(scalar: u64) -> U64x2

§Scalar Equivalent:
U64x2::from([scalar; 2])
§Avx2
Source§

fn broadcast_lo(vector: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([vector.as_array()[0]; 2])
§Avx2
Source§

fn cmp_eq(&self, other: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    if self.as_array()[0] == other.as_array()[0] {  u64::MAX  } else { 0 },
    if self.as_array()[1] == other.as_array()[1] {  u64::MAX  } else { 0 },
])
§Avx2
Source§

fn and_not(&self, other: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    self.as_array()[0] & (!other.as_array()[0]),
    self.as_array()[1] & (!other.as_array()[1]),
])
§Avx2
Source§

fn cmp_gt(&self, other: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    if self.as_array()[0] > other.as_array()[0] {  u64::MAX  } else { 0 },
    if self.as_array()[1] > other.as_array()[1] {  u64::MAX  } else { 0 },
])
§Avx2

NOTE: this implementation uses an efficient vector polyfill, though this operation is not natively supported.

// Based on https://stackoverflow.com/a/33173643 and https://git.io/JmghK
let sign_bit = Self::broadcast(1 << 63);
Self::from(I64x2::from(*self ^ sign_bit).cmp_gt(
    I64x2::from(other ^ sign_bit)
))
Source§

fn shift_left<const BITS: usize>(&self) -> U64x2

§Scalar Equivalent:
let mut out = self.as_array();
for x in out.iter_mut() {
    *x <<= BITS;
}
U64x2::from(out)
§Avx2
Source§

fn shift_right<const BITS: usize>(&self) -> U64x2

§Scalar Equivalent:
let mut out = self.as_array();
for x in out.iter_mut() {
    *x >>= BITS;
}
U64x2::from(out)
§Avx2
Source§

fn unpack_lo(&self, other: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    // Lane# 0
    self.as_array()[0],
    other.as_array()[0],
])
§Avx2
Source§

fn unpack_hi(&self, other: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    // Lane# 0
    self.as_array()[1],
    other.as_array()[1],
])
§Avx2
Source§

fn max(&self, other: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    self.as_array()[0].max(other.as_array()[0]),
    self.as_array()[1].max(other.as_array()[1]),
])
§Avx2

WARNING: this implementation is a polyfill which executes the scalar implemenation.

Source§

fn min(&self, other: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    self.as_array()[0].min(other.as_array()[0]),
    self.as_array()[1].min(other.as_array()[1]),
])
§Avx2

WARNING: this implementation is a polyfill which executes the scalar implemenation.

Source§

const LANES: usize = 2usize

The number of elements of this vector.
Source§

const ZERO: Self

A vector where every element is zero.
Source§

type Scalar = u64

The scalar that this value holds.
Source§

type Array = [u64; 2]

The equivalent array type of this vector.
Source§

type Signed = I64x2

The signed version of this vector.
Source§

type Unsigned = U64x2

The unsigned version of this vector.
Source§

type BroadcastLoInput = U64x2

A vector of [Self::Scalar; 128 / (8 * std::mem::size_of::<Self::Scalar>())]
Source§

fn as_array(&self) -> Self::Array

Convert the vector to an array.
Source§

impl SimdBase64 for U64x2

Source§

fn mul_lo(&self, other: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    ((self.as_array()[0] as u32) as u64) * ((other.as_array()[0] as u32) as u64),
    ((self.as_array()[1] as u32) as u64) * ((other.as_array()[1] as u32) as u64),
])
§Avx2
Source§

impl SimdBaseGatherable<I64x2> for U64x2

§Safety

base does not need to be aligned. Forall i, base + indices[i] must meet the safety requirements of std::ptr::read_unaligned

Source§

unsafe fn gather(base: *const u64, indices: I64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    base.offset(indices.as_array()[0] as isize).read_unaligned(),
    base.offset(indices.as_array()[1] as isize).read_unaligned(),
])
§Avx2
Source§

unsafe fn gather_masked( base: *const u64, indices: I64x2, mask: U64x2, src: U64x2, ) -> U64x2

§Scalar Equivalent:
U64x2::from([
    if (mask.as_array()[0] >> 63) == 1 {
        base.offset(indices.as_array()[0] as isize).read_unaligned()
    } else {
        src.as_array()[0]
    },
    if (mask.as_array()[1] >> 63) == 1 {
        base.offset(indices.as_array()[1] as isize).read_unaligned()
    } else {
        src.as_array()[1]
    },
])
§Avx2
Source§

impl SimdBaseGatherable<U64x2> for I64x2

§Safety

base does not need to be aligned. Forall i, base + indices[i] must meet the safety requirements of std::ptr::read_unaligned

Source§

unsafe fn gather(base: *const i64, indices: U64x2) -> I64x2

§Scalar Equivalent:
I64x2::from([
    base.offset(indices.as_array()[0] as isize).read_unaligned(),
    base.offset(indices.as_array()[1] as isize).read_unaligned(),
])
§Avx2
Source§

unsafe fn gather_masked( base: *const i64, indices: U64x2, mask: I64x2, src: I64x2, ) -> I64x2

§Scalar Equivalent:
I64x2::from([
    if ((mask.as_array()[0] as u64) >> 63) == 1 {
        base.offset(indices.as_array()[0] as isize).read_unaligned()
    } else {
        src.as_array()[0]
    },
    if ((mask.as_array()[1] as u64) >> 63) == 1 {
        base.offset(indices.as_array()[1] as isize).read_unaligned()
    } else {
        src.as_array()[1]
    },
])
§Avx2
Source§

impl SimdBaseGatherable<U64x2> for U64x2

§Safety

base does not need to be aligned. Forall i, base + indices[i] must meet the safety requirements of std::ptr::read_unaligned

Source§

unsafe fn gather(base: *const u64, indices: U64x2) -> U64x2

§Scalar Equivalent:
U64x2::from([
    base.offset(indices.as_array()[0] as isize).read_unaligned(),
    base.offset(indices.as_array()[1] as isize).read_unaligned(),
])
§Avx2
Source§

unsafe fn gather_masked( base: *const u64, indices: U64x2, mask: U64x2, src: U64x2, ) -> U64x2

§Scalar Equivalent:
U64x2::from([
    if (mask.as_array()[0] >> 63) == 1 {
        base.offset(indices.as_array()[0] as isize).read_unaligned()
    } else {
        src.as_array()[0]
    },
    if (mask.as_array()[1] >> 63) == 1 {
        base.offset(indices.as_array()[1] as isize).read_unaligned()
    } else {
        src.as_array()[1]
    },
])
§Avx2
Source§

impl Sub for U64x2

Source§

fn sub(self, rhs: U64x2) -> U64x2

Perform a pairwise wrapping_sub

§Scalar Equivalent
U64x2::from([
    self.as_array()[0].wrapping_sub(rhs.as_array()[0]),
    self.as_array()[1].wrapping_sub(rhs.as_array()[1]),
])
§AVX2 Intrinsics Used
§Neon Intrinsics Used
Source§

type Output = U64x2

The resulting type after applying the - operator.
Source§

impl SubAssign for U64x2

Source§

fn sub_assign(&mut self, other: U64x2)

Performs the -= operation. Read more
Source§

impl Zeroable for U64x2

§

fn zeroed() -> Self

Source§

impl Copy for U64x2

Source§

impl Eq for U64x2

Source§

impl Pod for U64x2

Auto Trait Implementations§

§

impl Freeze for U64x2

§

impl RefUnwindSafe for U64x2

§

impl Send for U64x2

§

impl Sync for U64x2

§

impl Unpin for U64x2

§

impl UnwindSafe for U64x2

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
§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

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

§

impl<T> NoUninit for T
where T: Pod,