package metadata

  1. Overview
  2. Docs

Abstractions for reading from various sources.

type t = {
  1. read : bytes -> int -> int -> int;
  2. read_ba : (int -> (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t) option;
  3. custom_parser : custom_parser option;
  4. seek : int -> unit;
  5. size : unit -> int option;
  6. reset : unit -> unit;
}

A function to read taking the buffer to fill the offset and the length and returning the number of bytes actually read.

val reset : t -> unit

Go back at the beginning of the stream.

val with_file : ?custom_parser:custom_parser -> (t -> metadata) -> string -> metadata

Specialize a parser to operate on files.

val with_string : ?custom_parser:custom_parser -> (t -> metadata) -> string -> metadata

Specialize a parser to operate on strings.

OCaml

Innovation. Community. Security.