Module Helper.Encoder

Parameters

module E : ENCODER
module FS : sig ... end

Signature

type error = [
| `Encoder of E.error
| FS.error Error.FS.t
]
val to_file : ?⁠limit:int -> ?⁠atomic:bool -> FS.t -> temp_dir:Fpath.t -> Fpath.t -> Cstruct.t -> E.state -> (E.resulterror) Stdlib.result Lwt.t

to_file t f tmp state encodes state in the file f using tmp as an intermediary buffer.

The result is Error `Stack if at least limit writes have returned 0.

If atomic is set, the operation is guaranteed to be atomic.