Trait core_simd::simd::ptr::SimdMutPtr

source ·
pub trait SimdMutPtr: Copy + Sealed {
    type Usize;
    type Isize;
    type CastPtr<T>;
    type ConstPtr;
    type Mask;

    // Required methods
    fn is_null(self) -> Self::Mask;
    fn cast<T>(self) -> Self::CastPtr<T>;
    fn cast_const(self) -> Self::ConstPtr;
    fn addr(self) -> Self::Usize;
    fn without_provenance(addr: Self::Usize) -> Self;
    fn with_addr(self, addr: Self::Usize) -> Self;
    fn expose_provenance(self) -> Self::Usize;
    fn with_exposed_provenance(addr: Self::Usize) -> Self;
    fn wrapping_offset(self, offset: Self::Isize) -> Self;
    fn wrapping_add(self, count: Self::Usize) -> Self;
    fn wrapping_sub(self, count: Self::Usize) -> Self;
}
🔬This is a nightly-only experimental API. (portable_simd)
Expand description

Operations on SIMD vectors of mutable pointers.

Required Associated Types§

source

type Usize

🔬This is a nightly-only experimental API. (portable_simd)

Vector of usize with the same number of elements.

source

type Isize

🔬This is a nightly-only experimental API. (portable_simd)

Vector of isize with the same number of elements.

source

type CastPtr<T>

🔬This is a nightly-only experimental API. (portable_simd)

Vector of const pointers with the same number of elements.

source

type ConstPtr

🔬This is a nightly-only experimental API. (portable_simd)

Vector of constant pointers to the same type.

source

type Mask

🔬This is a nightly-only experimental API. (portable_simd)

Mask type used for manipulating this SIMD vector type.

Required Methods§

source

fn is_null(self) -> Self::Mask

🔬This is a nightly-only experimental API. (portable_simd)

Returns true for each element that is null.

source

fn cast<T>(self) -> Self::CastPtr<T>

🔬This is a nightly-only experimental API. (portable_simd)

Casts to a pointer of another type.

Equivalent to calling pointer::cast on each element.

source

fn cast_const(self) -> Self::ConstPtr

🔬This is a nightly-only experimental API. (portable_simd)

Changes constness without changing the type.

Equivalent to calling pointer::cast_const on each element.

source

fn addr(self) -> Self::Usize

🔬This is a nightly-only experimental API. (portable_simd)

Gets the “address” portion of the pointer.

This method discards pointer semantic metadata, so the result cannot be directly cast into a valid pointer.

Equivalent to calling pointer::addr on each element.

source

fn without_provenance(addr: Self::Usize) -> Self

🔬This is a nightly-only experimental API. (portable_simd)

Convert an address to a pointer without giving it any provenance.

Without provenance, this pointer is not associated with any actual allocation. Such a no-provenance pointer may be used for zero-sized memory accesses (if suitably aligned), but non-zero-sized memory accesses with a no-provenance pointer are UB. No-provenance pointers are little more than a usize address in disguise.

This is different from Self::with_exposed_provenance, which creates a pointer that picks up a previously exposed provenance.

Equivalent to calling core::ptr::without_provenance on each element.

source

fn with_addr(self, addr: Self::Usize) -> Self

🔬This is a nightly-only experimental API. (portable_simd)

Creates a new pointer with the given address.

This performs the same operation as a cast, but copies the address-space and provenance of self to the new pointer.

Equivalent to calling pointer::with_addr on each element.

source

fn expose_provenance(self) -> Self::Usize

🔬This is a nightly-only experimental API. (portable_simd)

Exposes the “provenance” part of the pointer for future use in Self::with_exposed_provenance and returns the “address” portion.

source

fn with_exposed_provenance(addr: Self::Usize) -> Self

🔬This is a nightly-only experimental API. (portable_simd)

Convert an address back to a pointer, picking up a previously “exposed” provenance.

Equivalent to calling core::ptr::with_exposed_provenance_mut on each element.

source

fn wrapping_offset(self, offset: Self::Isize) -> Self

🔬This is a nightly-only experimental API. (portable_simd)

Calculates the offset from a pointer using wrapping arithmetic.

Equivalent to calling pointer::wrapping_offset on each element.

source

fn wrapping_add(self, count: Self::Usize) -> Self

🔬This is a nightly-only experimental API. (portable_simd)

Calculates the offset from a pointer using wrapping arithmetic.

Equivalent to calling pointer::wrapping_add on each element.

source

fn wrapping_sub(self, count: Self::Usize) -> Self

🔬This is a nightly-only experimental API. (portable_simd)

Calculates the offset from a pointer using wrapping arithmetic.

Equivalent to calling pointer::wrapping_sub on each element.

Object Safety§

This trait is not object safe.

Implementors§