Module

Node.Buffer.ST

#STBuffer

data STBuffer :: Region -> Typedata STBuffer t0

A reference to a mutable Buffer for use with ST

The type parameter represents the memory region which the (STBuffer h) belongs to.

Instances

#run

run :: (forall h. ST h (STBuffer h)) -> ImmutableBuffer

Runs an ST creating an STBuffer then freezes the (STBuffer h) and returns it, without unneccessary copying.

#create

create :: forall h. Int -> ST h (STBuffer h)

Creates a new STBuffer. Alias of alloc.

#alloc

alloc :: forall h. Int -> ST h (STBuffer h)

Creates a new STBuffer.

#allocUnsafe

allocUnsafe :: forall h. Int -> ST h (STBuffer h)

Creates a new STBuffer 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

allocUnsafeSlow :: forall h. Int -> ST h (STBuffer h)

Creates a new STBuffer 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

#compareParts

compareParts :: forall h. STBuffer h -> STBuffer h -> Int -> Int -> Int -> Int -> ST h Ordering

#freeze

freeze :: forall h. (STBuffer h) -> ST h ImmutableBuffer

#unsafeFreeze

#thaw

thaw :: forall h. ImmutableBuffer -> ST h (STBuffer h)

#unsafeThaw

unsafeThaw :: forall h. ImmutableBuffer -> ST h (STBuffer h)

#fromArray

fromArray :: forall h. Array Octet -> ST h (STBuffer h)

#fromString

fromString :: forall h. String -> Encoding -> ST h (STBuffer h)

#fromArrayBuffer

fromArrayBuffer :: forall h. ArrayBuffer -> ST h (STBuffer h)

#toArrayBuffer

toArrayBuffer :: forall h. STBuffer h -> ST h ArrayBuffer

#read

read :: forall h. BufferValueType -> Offset -> STBuffer h -> ST h Number

#readString

readString :: forall h. Encoding -> Offset -> Offset -> STBuffer h -> ST h String

#toString

toString :: forall h. Encoding -> STBuffer h -> ST h String

#toString'

toString' :: forall h. Encoding -> Offset -> Offset -> STBuffer h -> ST h String

#write

write :: forall h. BufferValueType -> Number -> Offset -> STBuffer h -> ST h Unit

#writeString

writeString :: forall h. Encoding -> Offset -> Int -> String -> STBuffer h -> ST h Int

#toArray

toArray :: forall h. STBuffer h -> ST h (Array Octet)

#getAtOffset

getAtOffset :: forall h. Offset -> STBuffer h -> ST h (Maybe Octet)

#setAtOffset

setAtOffset :: forall h. Octet -> Offset -> STBuffer h -> ST h Unit

#slice

slice :: forall h. Offset -> Offset -> STBuffer h -> STBuffer h

#size

size :: forall h. STBuffer h -> ST h Int

#concat

concat :: forall h. Array (STBuffer h) -> ST h (STBuffer h)

#concat'

concat' :: forall h. Array (STBuffer h) -> Int -> ST h (STBuffer h)

#copy

copy :: forall h. Offset -> Offset -> STBuffer h -> Offset -> STBuffer h -> ST h Int

#fill

fill :: forall h. Octet -> Offset -> Offset -> STBuffer h -> ST h Unit

#swap16

swap16 :: forall h. STBuffer h -> ST h (STBuffer h)

#swap32

swap32 :: forall h. STBuffer h -> ST h (STBuffer h)

#swap64

swap64 :: forall h. STBuffer h -> ST h (STBuffer h)

#transcode

transcode :: forall h. STBuffer h -> Encoding -> Encoding -> ST h (STBuffer h)

Modules