OCaml Library Collection
/

Eio integration for Init INI parser.

Provides file system operations using Eio paths and flows.

Error handling

type Eio.Exn.err +=
  1. | E of Init.Error.t
    (*

    Eio exception for Init errors.

    *)
val err : Init.Error.t -> exn

err e creates an Eio exception from e.

Path operations

val decode_path : ?config:Init_bytesrw.config -> ?locs:bool -> ?layout:bool -> 'a Init.t -> _ Eio.Path.t -> ('a, Init.Error.t) result

decode_path codec path reads and decodes the file at path.

val decode_path_exn : ?config:Init_bytesrw.config -> ?locs:bool -> ?layout:bool -> 'a Init.t -> _ Eio.Path.t -> 'a

decode_path_exn is like decode_path but raises on error.

val encode_path : ?buf:bytes -> 'a Init.t -> 'a -> _ Eio.Path.t -> (unit, Init.Error.t) result

encode_path codec v path encodes v and writes to path.

val encode_path_exn : ?buf:bytes -> 'a Init.t -> 'a -> _ Eio.Path.t -> unit

encode_path_exn is like encode_path but raises on error.

Flow operations

val decode_flow : ?config:Init_bytesrw.config -> ?locs:bool -> ?layout:bool -> ?file:Init.Textloc.fpath -> 'a Init.t -> _ Eio.Flow.source -> ('a, Init.Error.t) result

decode_flow codec flow decodes from flow.

val decode_flow_exn : ?config:Init_bytesrw.config -> ?locs:bool -> ?layout:bool -> ?file:Init.Textloc.fpath -> 'a Init.t -> _ Eio.Flow.source -> 'a

decode_flow_exn is like decode_flow but raises on error.

val encode_flow : ?buf:bytes -> 'a Init.t -> 'a -> eod:bool -> _ Eio.Flow.sink -> (unit, Init.Error.t) result

encode_flow codec v flow encodes v to flow.

val encode_flow_exn : ?buf:bytes -> 'a Init.t -> 'a -> eod:bool -> _ Eio.Flow.sink -> unit

encode_flow_exn is like encode_flow but raises on error.