Trait ArrayBufferCopy

Source
pub trait ArrayBufferCopy<T> {
    // Required methods
    fn from_slice(src: &[T]) -> Self;
    fn copy_from(&self, src: &[T]);
    fn copy_to(&self, dst: &mut [T]);
    fn to_vec(&self) -> Vec<T>;
}
Expand description

Copy array buffer on the js side.

Required Methods§

Source

fn from_slice(src: &[T]) -> Self

Copy slice to js array, return js typed array.

Source

fn copy_from(&self, src: &[T])

Copy slice to js array.

Source

fn copy_to(&self, dst: &mut [T])

Copy js array to slice.

Source

fn to_vec(&self) -> Vec<T>

Copy js array to slice, return Vec<T>.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ArrayBufferCopy<f32> for Float32Array

Source§

fn from_slice(src: &[f32]) -> Self

Source§

fn copy_from(&self, src: &[f32])

Source§

fn copy_to(&self, dst: &mut [f32])

Source§

fn to_vec(&self) -> Vec<f32>

Source§

impl ArrayBufferCopy<f64> for Float64Array

Source§

fn from_slice(src: &[f64]) -> Self

Source§

fn copy_from(&self, src: &[f64])

Source§

fn copy_to(&self, dst: &mut [f64])

Source§

fn to_vec(&self) -> Vec<f64>

Source§

impl ArrayBufferCopy<i8> for Int8Array

Source§

fn from_slice(src: &[i8]) -> Self

Source§

fn copy_from(&self, src: &[i8])

Source§

fn copy_to(&self, dst: &mut [i8])

Source§

fn to_vec(&self) -> Vec<i8>

Source§

impl ArrayBufferCopy<i16> for Int16Array

Source§

fn from_slice(src: &[i16]) -> Self

Source§

fn copy_from(&self, src: &[i16])

Source§

fn copy_to(&self, dst: &mut [i16])

Source§

fn to_vec(&self) -> Vec<i16>

Source§

impl ArrayBufferCopy<i32> for Int32Array

Source§

fn from_slice(src: &[i32]) -> Self

Source§

fn copy_from(&self, src: &[i32])

Source§

fn copy_to(&self, dst: &mut [i32])

Source§

fn to_vec(&self) -> Vec<i32>

Source§

impl ArrayBufferCopy<i64> for BigInt64Array

Source§

fn from_slice(src: &[i64]) -> Self

Source§

fn copy_from(&self, src: &[i64])

Source§

fn copy_to(&self, dst: &mut [i64])

Source§

fn to_vec(&self) -> Vec<i64>

Source§

impl ArrayBufferCopy<u8> for Uint8Array

Source§

fn from_slice(src: &[u8]) -> Self

Source§

fn copy_from(&self, src: &[u8])

Source§

fn copy_to(&self, dst: &mut [u8])

Source§

fn to_vec(&self) -> Vec<u8>

Source§

impl ArrayBufferCopy<u8> for Uint8ClampedArray

Source§

fn from_slice(src: &[u8]) -> Self

Source§

fn copy_from(&self, src: &[u8])

Source§

fn copy_to(&self, dst: &mut [u8])

Source§

fn to_vec(&self) -> Vec<u8>

Source§

impl ArrayBufferCopy<u16> for Uint16Array

Source§

fn from_slice(src: &[u16]) -> Self

Source§

fn copy_from(&self, src: &[u16])

Source§

fn copy_to(&self, dst: &mut [u16])

Source§

fn to_vec(&self) -> Vec<u16>

Source§

impl ArrayBufferCopy<u32> for Uint32Array

Source§

fn from_slice(src: &[u32]) -> Self

Source§

fn copy_from(&self, src: &[u32])

Source§

fn copy_to(&self, dst: &mut [u32])

Source§

fn to_vec(&self) -> Vec<u32>

Source§

impl ArrayBufferCopy<u64> for BigUint64Array

Source§

fn from_slice(src: &[u64]) -> Self

Source§

fn copy_from(&self, src: &[u64])

Source§

fn copy_to(&self, dst: &mut [u64])

Source§

fn to_vec(&self) -> Vec<u64>

Implementors§