Module

Node.Buffer

Package
purescript-node-buffer
Repository
purescript-node/purescript-node-buffer

Mutable buffers and associated operations.

#Buffer Source

data Buffer

A reference to a mutable buffer for use with Effect

Instances

#create Source

create :: Int -> Effect Buffer

Creates a new buffer of the specified size. Alias to alloc.

#alloc Source

alloc :: Int -> Effect Buffer

Creates a new buffer of the specified size.

#allocUnsafe Source

allocUnsafe :: Int -> Effect Buffer

Creates a new buffer of the specified size. Unsafe because it reuses memory from a pool and may contain sensitive data. See the Node docs: https://nodejs.org/docs/latest-v18.x/api/buffer.html#what-makes-bufferallocunsafe-and-bufferallocunsafeslow-unsafe

#allocUnsafeSlow Source

allocUnsafeSlow :: Int -> Effect Buffer

Creates a new buffer of the specified size. Unsafe because it reuses memory from a pool and may contain sensitive data. See the Node docs: https://nodejs.org/docs/latest-v18.x/api/buffer.html#what-makes-bufferallocunsafe-and-bufferallocunsafeslow-unsafe

#poolSize Source

poolSize :: Effect (Int)

The size (in bytes) of pre-allocated internal Buffer instances used for pooling. This value may be modified.

#setPoolSize Source

Re-exports from Node.Buffer.Types

#Offset Source

type Offset = Int

Type synonym indicating the value refers to an offset in a buffer.

#Octet Source

type Octet = Int

Type synonym indicating the value should be an octet (0-255). If the value provided is outside this range it will be used as modulo 256.

#BufferValueType Source

data BufferValueType

Enumeration of the numeric types that can be written to a buffer.

Constructors

Instances