package eio

  1. Overview
  2. Docs
module type SOURCE = sig ... end
module type SINK = sig ... end
module type SHUTDOWN = sig ... end
val source : (module SOURCE with type t = 't) -> ('t, source_ty) Resource.handler
val sink : (module SINK with type t = 't) -> ('t, sink_ty) Resource.handler
val shutdown : (module SHUTDOWN with type t = 't) -> ('t, shutdown_ty) Resource.handler
module type TWO_WAY = sig ... end
val two_way : (module TWO_WAY with type t = 't) -> ('t, two_way_ty) Resource.handler
type Resource.pi +=
  1. | Source : ('t, (module SOURCE with type t = 't), [> source_ty ]) Resource.pi
  2. | Sink : ('t, (module SINK with type t = 't), [> sink_ty ]) Resource.pi
  3. | Shutdown : ('t, (module SHUTDOWN with type t = 't), [> shutdown_ty ]) Resource.pi
val simple_copy : single_write:('t -> Cstruct.t list -> int) -> 't -> src:_ source -> unit

simple_copy ~single_write implements SINK's copy API using single_write.

OCaml

Innovation. Community. Security.