Type Alias neon::types::JsUint8Array

source ·
pub type JsUint8Array = JsTypedArray<u8>;
Expand description

The type of JavaScript Uint8Array objects.

§Example

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

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

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

    Ok(cx.undefined())
}

Aliased Type§

struct JsUint8Array(/* private fields */);