package bare_encoding

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Bare_encoding.DecodeSource

Decoders.

This module provides a decoder type Decode.t to hold the decoding state, along with functions to decode specific primitives.

Sourcetype t = {
  1. bs : bytes;
  2. mutable off : int;
}

A decoder state, operating on a slice of bytes.

Sourceexception Error of string
Sourcetype 'a dec = t -> 'a

A decoder for values of type 'a. Decoders will raise Error to indicate failure.

Sourceval uint : t -> int64

Decode a varint-encoded unsigned integer

Sourceval int : t -> int64

Decode a varint-encoded integer

Sourceval u8 : t -> char
Sourceval u16 : t -> int
Sourceval u32 : t -> int32
Sourceval u64 : t -> int64
Sourceval i8 : t -> char
Sourceval i16 : t -> int
Sourceval i32 : t -> int32
Sourceval i64 : t -> int64
Sourceval bool : t -> bool
Sourceval f32 : t -> float
Sourceval f64 : t -> float
Sourceval string : t -> string
Sourceval data : t -> bytes
Sourceval data_of : size:int -> t -> bytes
Sourceval optional : 'a dec -> 'a option dec