package streamable

  1. Overview
  2. Docs
A collection of types suitable for incremental serialization.

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.17.1.tar.gz
md5=f8ef1a28079f4e6e6617ba2cfa51bc4e
sha512=2f56d8b10032756c3190b0e68094f0c89f96f9f3fc39d5a8c62f340abe837c7ba1c75f99c914213cbb6376dc6f3abac689110d18af226998bba4484dd9ff3c47

doc/src/ppx_streamable/version.ml.html

Source file version.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
open! Base
open! Import

type t = V1 [@@deriving enumerate]

let to_int = function
  | V1 -> 1
;;

let of_int_exn loc = function
  | 1 -> V1
  | n ->
    Location.raise_errorf
      ~loc
      !"Unknown ppx_streamable version: %d. The supported versions are: {%s}"
      n
      (all |> List.map ~f:(Fn.compose Int.to_string to_int) |> String.concat ~sep:", ")
;;

let module_name = function
  | V1 -> "V1"
;;