gossamer/array_buffer

Types

pub type ArrayBuffer
pub type ArrayBufferView {
  ArrayBufferView(
    buffer: ArrayBuffer,
    byte_length: Int,
    byte_offset: Int,
  )
}

Constructors

  • ArrayBufferView(
      buffer: ArrayBuffer,
      byte_length: Int,
      byte_offset: Int,
    )

Values

pub fn byte_length(of array_buffer: ArrayBuffer) -> Int
pub fn is_detached(array_buffer: ArrayBuffer) -> Bool
pub fn is_resizable(array_buffer: ArrayBuffer) -> Bool
pub fn is_view(value: a) -> Bool
pub fn max_byte_length(of array_buffer: ArrayBuffer) -> Int
pub fn new(byte_length: Int) -> Result(ArrayBuffer, String)
pub fn new_resizable(
  byte_length: Int,
  max_byte_length max: Int,
) -> Result(ArrayBuffer, String)

Creates a resizable ArrayBuffer with the given initial byte length and maximum byte length.

pub fn resize(
  array_buffer: ArrayBuffer,
  to byte_length: Int,
) -> Result(Nil, String)

Resizes the ArrayBuffer to the specified byte length. The buffer must have been created with new_resizable. Returns an error if the new length exceeds the maximum byte length.

pub fn slice(
  array_buffer: ArrayBuffer,
  from begin: Int,
) -> ArrayBuffer
pub fn slice_with_end(
  array_buffer: ArrayBuffer,
  from begin: Int,
  to end: Int,
) -> ArrayBuffer
pub fn transfer(
  array_buffer: ArrayBuffer,
) -> Result(ArrayBuffer, String)
Search Document