neon::types

Type Alias JsFloat32Array

Source
pub type JsFloat32Array = JsTypedArray<f32>;
Expand description

The type of JavaScript Float32Array objects.

§Example

use neon::types::buffer::TypedArray;

fn double(mut cx: FunctionContext) -> JsResult<JsUndefined> {
    let mut array: Handle<JsFloat32Array> = cx.argument(0)?;

    for elem in array.as_mut_slice(&mut cx).iter_mut() {
        *elem *= 2.0;
    }

    Ok(cx.undefined())
}

Aliased Type§

struct JsFloat32Array(/* private fields */);