package colombe

  1. Overview
  2. Docs
type decoder = {
  1. buffer : bytes;
  2. mutable pos : int;
  3. mutable max : int;
}
val pp : decoder Fmt.t
val io_buffer_size : int
val decoder : unit -> decoder
val decoder_from : string -> decoder
val end_of_input : decoder -> int
type error = [
  1. | `End_of_input
  2. | `Expected_char of char
  3. | `Unexpected_char of char
  4. | `Expected_string of string
  5. | `Expected_eol
  6. | `Expected_eol_or_space
  7. | `Not_enough_space
  8. | `Assert_predicate of char -> bool
]
val pp_error : error Fmt.t
type 'err info = {
  1. error : 'err;
  2. buffer : bytes;
  3. committed : int;
}
type ('v, 'err) state =
  1. | Done of 'v
  2. | Read of {
    1. buffer : bytes;
    2. off : int;
    3. len : int;
    4. continue : int -> ('v, 'err) state;
    }
  3. | Error of 'err info
val safe : (decoder -> ('v, [> error ] as 'err) state) -> decoder -> ('v, 'err) state
val leave_with : decoder -> error -> 'a
val fail : decoder -> [> error ] as 'err -> ('v, 'err) state
val return : 'v -> decoder -> ('v, 'err) state
val peek_char : decoder -> char option
val string : string -> decoder -> unit
val junk_char : decoder -> unit
val while1 : (char -> bool) -> decoder -> bytes * int * int
val at_least_one_line : ?relax:bool -> decoder -> bool
val prompt : ?relax:bool -> (decoder -> ('v, [> error ] as 'err) state) -> decoder -> ('v, 'err) state
val peek_while_eol : ?relax:bool -> decoder -> bytes * int * int
val peek_while_eol_or_space : ?relax:bool -> decoder -> bytes * int * int
OCaml

Innovation. Community. Security.