packstream-bolt-0.1.0.0: PackStream binary serialization format
Safe HaskellNone
LanguageGHC2021

Data.PackStream.Get.Internal

Description

Internal module. Not part of the public API.

Synopsis

Documentation

getNull :: Get () Source #

Decode a PackStream null value.

tryNull :: Word8 -> (() -> a) -> Get a -> Get a Source #

Try to decode null given a tag byte; apply f on success or fall through to the continuation.

getBoolean :: Get Bool Source #

Decode a PackStream boolean value.

tryBoolean :: Word8 -> (Bool -> a) -> Get a -> Get a Source #

Try to decode a boolean given a tag byte; apply f on success or fall through to the continuation.

getFloat :: Get Double Source #

Decode a PackStream 64-bit float.

tryFloat :: Word8 -> (Double -> a) -> Get a -> Get a Source #

Try to decode a float given a tag byte; apply f on success or fall through to the continuation.

getString :: Get Text Source #

Decode a PackStream UTF-8 string.

tryString :: Word8 -> (Text -> a) -> Get a -> Get a Source #

Try to decode a string given a tag byte; apply f on success or fall through to the continuation.

getBytes :: Get ByteString Source #

Decode a PackStream byte array.

tryBytes :: Word8 -> (ByteString -> a) -> Get a -> Get a Source #

Try to decode a byte array given a tag byte; apply f on success or fall through to the continuation.

getList :: Get a -> Get (Vector a) Source #

Decode a PackStream list using the given element decoder.

tryList :: Get b -> Word8 -> (Vector b -> a) -> Get a -> Get a Source #

Try to decode a list given a tag byte; apply f on success or fall through to the continuation.

getDictionary :: Hashable a => Get a -> Get b -> Get (HashMap a b) Source #

Decode a PackStream dictionary using the given key and value decoders.

tryDictionary :: Hashable k => Get k -> Get v -> Word8 -> (HashMap k v -> a) -> Get a -> Get a Source #

Try to decode a dictionary given a tag byte; apply f on success or fall through to the continuation.

tryStructure :: Get b -> Word8 -> ((Word8, Vector b) -> a) -> Get a -> Get a Source #

Try to decode a structure given a tag byte; returns (structTag, fields) via f on success.