glepack/decode

This module provides functions to decode MessagePack data

Functions

pub fn value(
  input: BitArray,
) -> Result(#(Value, BitArray), DecodeError)

Decodes a MessagePack value from a BitArray Returns a tuple with the decoded value and the remaining BitArray

Errors

This function can return the following errors:

  • InvalidFormat: When the input data is not valid MessagePack
  • IncompleteData: When the input data is incomplete and more bytes are needed
  • IntegerTooLarge: When the input contains an integer that is too large for Gleam’s Int type
  • InvalidUtf8: When the input contains a string that is not valid UTF-8
  • ReservedFormat: When the input contains a reserved format (0xc1)
  • UnknownFormat: When an unknown format was encountered
  • UnsupportedExtension: When the input contains an extension type that is not supported
Search Document