[][src]Enum typed_array::TypedArray

pub enum TypedArray {
    Int8Array(Int8Array),
    Uint8Array(Uint8Array),
    Uint8ClampedArray(Uint8ClampedArray),
    Int16Array(Int16Array),
    Uint16Array(Uint16Array),
    Int32Array(Int32Array),
    Uint32Array(Uint32Array),
    Float32Array(Float32Array),
    Float64Array(Float64Array),
}

An enum of all of the typed arrays that is available in Javascipt. Common functionality is implemented on this type to make handling all variants easier.

Variants

Int8Array(Int8Array)Uint8Array(Uint8Array)Uint8ClampedArray(Uint8ClampedArray)Int16Array(Int16Array)Uint16Array(Uint16Array)Int32Array(Int32Array)Uint32Array(Uint32Array)Float32Array(Float32Array)Float64Array(Float64Array)

Methods

impl TypedArray[src]

pub fn buffer(&self) -> ArrayBuffer[src]

The buffer accessor property represents the ArrayBuffer referenced by a TypedArray at construction time.

pub fn subarray(&self, begin: u32, end: u32) -> Self[src]

The subarray() method stores multiple values in the typed array, reading input values from a specified array.

pub fn slice(&self, begin: u32, end: u32) -> Self[src]

The slice() method returns a shallow copy of a portion of a typed array into a new typed array object. This method has the same algorithm as Array.prototype.slice().

pub fn length(&self) -> u32[src]

The length accessor property represents the length (in elements) of a typed array.

pub fn byte_length(&self) -> u32[src]

The byteLength accessor property represents the length (in bytes) of a typed array.

pub fn byte_offset(&self) -> u32[src]

The byteOffset accessor property represents the offset (in bytes) of a typed array from the start of its ArrayBuffer.

pub fn set(&self, src: &JsValue, offset: u32)[src]

The set() method stores multiple values in the typed array, reading input values from a specified array.

pub fn has_type(i: JsValue) -> bool[src]

Tests whether the provided value is a typed array.

pub fn dyn_into(i: JsValue) -> Result<Self, JsValue>[src]

If the provided value is a typed array, returns TypedArray. If not, returns the provided value.

Trait Implementations

impl AsRef<JsValue> for TypedArray[src]

impl AsRef<Object> for TypedArray[src]

impl From<Int8Array> for TypedArray[src]

fn from(i: Int8Array) -> Self[src]

Convert the primitive array to a TypedArray instance.

impl From<Uint8Array> for TypedArray[src]

fn from(i: Uint8Array) -> Self[src]

Convert the primitive array to a TypedArray instance.

impl From<Uint8ClampedArray> for TypedArray[src]

fn from(i: Uint8ClampedArray) -> Self[src]

Convert the primitive array to a TypedArray instance.

impl From<Int16Array> for TypedArray[src]

fn from(i: Int16Array) -> Self[src]

Convert the primitive array to a TypedArray instance.

impl From<Uint16Array> for TypedArray[src]

fn from(i: Uint16Array) -> Self[src]

Convert the primitive array to a TypedArray instance.

impl From<Int32Array> for TypedArray[src]

fn from(i: Int32Array) -> Self[src]

Convert the primitive array to a TypedArray instance.

impl From<Uint32Array> for TypedArray[src]

fn from(i: Uint32Array) -> Self[src]

Convert the primitive array to a TypedArray instance.

impl From<Float32Array> for TypedArray[src]

fn from(i: Float32Array) -> Self[src]

Convert the primitive array to a TypedArray instance.

impl From<Float64Array> for TypedArray[src]

fn from(i: Float64Array) -> Self[src]

Convert the primitive array to a TypedArray instance.

impl Clone for TypedArray[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for TypedArray[src]

impl TryFrom<TypedArray> for Int8Array[src]

type Error = TryFromTypedArrayError

The type returned in the event of a conversion error.

impl TryFrom<TypedArray> for Uint8Array[src]

type Error = TryFromTypedArrayError

The type returned in the event of a conversion error.

impl TryFrom<TypedArray> for Uint8ClampedArray[src]

type Error = TryFromTypedArrayError

The type returned in the event of a conversion error.

impl TryFrom<TypedArray> for Int16Array[src]

type Error = TryFromTypedArrayError

The type returned in the event of a conversion error.

impl TryFrom<TypedArray> for Uint16Array[src]

type Error = TryFromTypedArrayError

The type returned in the event of a conversion error.

impl TryFrom<TypedArray> for Int32Array[src]

type Error = TryFromTypedArrayError

The type returned in the event of a conversion error.

impl TryFrom<TypedArray> for Uint32Array[src]

type Error = TryFromTypedArrayError

The type returned in the event of a conversion error.

impl TryFrom<TypedArray> for Float32Array[src]

type Error = TryFromTypedArrayError

The type returned in the event of a conversion error.

impl TryFrom<TypedArray> for Float64Array[src]

type Error = TryFromTypedArrayError

The type returned in the event of a conversion error.

impl TryFrom<JsValue> for TypedArray[src]

type Error = TryFromJsValueError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]