gossamer/biguint64_array
Types
A typed array of 64-bit unsigned integers, holding BigInt values.
See BigUint64Array on MDN.
pub type BigUint64Array
Values
pub fn at(
array: BigUint64Array,
index index: Int,
) -> Result(big_int.BigInt, Nil)
Returns the element at index, or Error(Nil) if the index is
out of range. Negative indices count from the end.
pub fn buffer(
of array: BigUint64Array,
) -> array_buffer.ArrayBuffer
pub fn byte_length(of array: BigUint64Array) -> Int
pub fn byte_offset(of array: BigUint64Array) -> Int
pub fn fill(
array: BigUint64Array,
with value: big_int.BigInt,
) -> BigUint64Array
pub fn from_buffer(
buffer: array_buffer.ArrayBuffer,
) -> Result(BigUint64Array, js_error.JsError)
Creates a BigUint64Array view over buffer. Returns an error if
buffer.byteLength is not a multiple of 8 (the element size).
pub fn from_buffer_range(
buffer: array_buffer.ArrayBuffer,
byte_offset byte_offset: Int,
length length: Int,
) -> Result(BigUint64Array, js_error.JsError)
Creates a BigUint64Array view over a slice of buffer starting at
byte_offset and spanning length elements. Returns an error if
the range is out of bounds, buffer is detached, or byte_offset
is not a multiple of 8.
pub fn from_length(
length: Int,
) -> Result(BigUint64Array, js_error.JsError)
Creates a zero-filled BigUint64Array of the given length. Returns
an error if length is negative or exceeds the maximum allocatable
size.
pub fn from_list(list: List(big_int.BigInt)) -> BigUint64Array
Creates a BigUint64Array from a list of BigInt values. Values
outside 0 to 2^64 − 1 are wrapped modulo 2^64, matching the JS
BigUint64Array constructor.
pub fn includes(
in array: BigUint64Array,
value value: big_int.BigInt,
) -> Bool
pub fn index_of(
in array: BigUint64Array,
value value: big_int.BigInt,
) -> Result(Int, Nil)
Returns the first index of value, or Error(Nil) if not present.
pub fn last_index_of(
in array: BigUint64Array,
value value: big_int.BigInt,
) -> Result(Int, Nil)
Returns the last index of value, or Error(Nil) if not present.
pub fn length(of array: BigUint64Array) -> Int
pub fn new() -> BigUint64Array
pub fn reverse(array: BigUint64Array) -> BigUint64Array
pub fn set(
in array: BigUint64Array,
values values: BigUint64Array,
) -> Result(Nil, js_error.JsError)
Copies values into array starting at index 0. Returns an
error if values would extend past the end of array.
pub fn set_with_offset(
in array: BigUint64Array,
values values: BigUint64Array,
offset offset: Int,
) -> Result(Nil, js_error.JsError)
Copies values into array starting at offset. Returns an
error if offset is negative or the copy would extend past the
end of array.
pub fn slice(array: BigUint64Array) -> BigUint64Array
pub fn slice_range(
array: BigUint64Array,
from start: Int,
to end: Int,
) -> BigUint64Array
pub fn subarray(
array: BigUint64Array,
from begin: Int,
to end: Int,
) -> BigUint64Array
pub fn to_list(array: BigUint64Array) -> List(big_int.BigInt)
pub fn with(
array: BigUint64Array,
at_index index: Int,
value value: big_int.BigInt,
) -> Result(BigUint64Array, js_error.JsError)
Returns a copy of array with the value at index replaced.
Negative indices count from the end. Returns an error if index
is out of range.