Module

Data.ArrayBuffer.Class

Package
purescript-arraybuffer-class
Repository
athanclark/purescript-arraybuffer-class

#EncodeArrayBuffer Source

class EncodeArrayBuffer a  where

Members

  • putArrayBuffer :: ArrayBuffer -> ByteOffset -> a -> Effect (Maybe ByteLength)

    Returns the bytes written indicating partial success - for exact success, the written bytes should equal the value's dynamic byteLength. This function should strictly write to the ArrayBuffer, and shouldn't attempt to read from it.

Instances

#DecodeArrayBuffer Source

class DecodeArrayBuffer a  where

Members

Instances

#DynamicByteLength Source

class DynamicByteLength a  where

Members

Instances

#encodeArrayBuffer Source

encodeArrayBuffer :: forall a. EncodeArrayBuffer a => DynamicByteLength a => a -> Effect ArrayBuffer

Generate a new ArrayBuffer from a value. Throws an Error if writing fails, or if the written bytes do not equal the dynamic byteLength of the value.

#decodeArrayBuffer Source

decodeArrayBuffer :: forall a. DecodeArrayBuffer a => ArrayBuffer -> Effect (Maybe a)

Attempt to parse a value from an ArrayBuffer, starting at the first index.

#GEncodeArrayBuffer Source

class GEncodeArrayBuffer (row :: Row Type) (list :: RowList)  where

Members

Instances

#GDecodeArrayBuffer Source

class GDecodeArrayBuffer (row :: Row Type) (list :: RowList) | list -> row where

Members

Instances

#genericByteLength Source

genericByteLength :: forall rep a. Generic a rep => DynamicByteLength rep => a -> Effect ByteLength

Determine a data type's byte length by walking its generic structure - note there is significant overhead due to nested Sum types.

#genericPutArrayBuffer Source

genericPutArrayBuffer :: forall rep a. Generic a rep => EncodeArrayBuffer rep => ArrayBuffer -> ByteOffset -> a -> Effect (Maybe ByteLength)

Write data to an ArrayBuffer by walking its Generic structure - note this causes significant overhead from nested Sum types.

#genericReadArrayBuffer Source

genericReadArrayBuffer :: forall rep a. Generic a rep => DecodeArrayBuffer rep => ArrayBuffer -> ByteOffset -> Effect (Maybe a)

Read data from an ArrayBuffer by building its Generic structure - note this causes significant overhead from nested Sum types.

Re-exports from Data.ArrayBuffer.Class.Types