Struct v128

#[repr(simd)]
pub struct v128(pub(in ::core_arch::wasm32::simd128) [i32; 4]);

WASM-specific 128-bit wide SIMD vector type.

This type corresponds to the v128 type in the WebAssembly SIMD proposal. This type is 128-bits large and the meaning of all the bits is defined within the context of how this value is used.

This same type is used simultaneously for all 128-bit-wide SIMD types, for example:

The v128 type in Rust is intended to be quite analogous to the v128 type in WebAssembly. Operations on v128 can only be performed with the functions in this module.

Fields

0: [i32; 4]

Implementations

impl v128

fn splat(value: i32) -> v128

Put the same value in every lane.

const fn as_array(&self) -> &[i32; 4]

Returns an array reference containing the entire SIMD vector.

fn as_mut_array(&mut self) -> &mut [i32; 4]

Returns a mutable array reference containing the entire SIMD vector.

impl v128

fn as_u8x16(self) -> Simd<u8, 16>
fn as_u16x8(self) -> Simd<u16, 8>
fn as_u32x4(self) -> Simd<u32, 4>
fn as_u64x2(self) -> Simd<u64, 2>
fn as_i8x16(self) -> Simd<i8, 16>
fn as_i16x8(self) -> Simd<i16, 8>
fn as_i32x4(self) -> Simd<i32, 4>
fn as_i64x2(self) -> Simd<i64, 2>
fn as_f32x4(self) -> Simd<f32, 4>
fn as_f64x2(self) -> Simd<f64, 2>

Trait Implementations

impl Clone for v128

fn clone(&self) -> v128

impl Copy for v128

impl Debug for v128

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

impl From<Simd<i32, 4>> for v128

fn from(simd: Simd<i32, 4>) -> Self

impl TrivialClone for v128

Auto Trait Implementations

impl Freeze for v128

impl RefUnwindSafe for v128

impl Send for v128

impl Sync for v128

impl Unpin for v128

impl UnsafeUnpin for v128

impl UnwindSafe for v128

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for v128

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Printable for v128 where T: Copy + Debug,

impl<T> SizeHint for v128 where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for v128

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

fn into(self) -> U

Calls U::from(self).

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

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

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

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

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