mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-18 07:21:24 +00:00
Add get/set for TypedArray
s. (#2001)
* Add get/set for `TypedArray`s. * Change names. * Change name to @pauan suggestion.
This commit is contained in:
committed by
GitHub
parent
b6190700c9
commit
7db01a7c7c
@ -4884,6 +4884,14 @@ macro_rules! arrays {
|
||||
/// input values from a specified array.
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn set(this: &$name, src: &JsValue, offset: u32);
|
||||
|
||||
/// Gets the value at `idx`, equivalent to the javascript `my_var = arr[idx]`.
|
||||
#[wasm_bindgen(method, structural, indexing_getter)]
|
||||
pub fn get_index(this: &$name, idx: u32) -> $ty;
|
||||
|
||||
/// Sets the value at `idx`, equivalent to the javascript `arr[idx] = value`.
|
||||
#[wasm_bindgen(method, structural, indexing_setter)]
|
||||
pub fn set_index(this: &$name, idx: u32, value: $ty);
|
||||
}
|
||||
|
||||
impl $name {
|
||||
|
Reference in New Issue
Block a user