Type Definition neon::types::JsInt8Array

source · []
pub type JsInt8Array = JsTypedArray<i8>;
Expand description

The standard JS Int8Array type.

Example

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

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

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

    Ok(cx.undefined())
}