package dream-httpaf

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Httpaf = Dream_httpaf_.Httpaf
module Writer = Serialize.Writer
type error = [
  1. | `Bad_request
  2. | `Internal_server_error
  3. | `Exn of exn
]
type error_handler = ?request:Request.t -> error -> (Headers.t -> Body.Writer.t) -> unit
type response_state =
  1. | Waiting
  2. | Fixed of {
    1. response : Response.t;
    2. mutable iovec : [ `String of string | `Bigstring of Bigstringaf.t ] Httpaf.IOVec.t;
    }
  3. | Streaming of {
    1. response : Response.t;
    2. response_body : Body.Writer.t;
    3. trailers : Headers.t;
    }
  4. | Complete of Response.t
type request_info = {
  1. request : Request.t;
  2. request_body : Body.Reader.t;
  3. mutable request_body_bytes : int64;
}
type active_stream = {
  1. body_buffer_size : int;
  2. encoder : Dream_h2.Stream.Hpack.Encoder.t;
  3. mutable response_state : response_state;
  4. mutable trailers_parser : Stream.partial_headers option;
  5. mutable trailers : Headers.t option;
  6. create_push_stream : Stream_identifier.t -> (t, [ `Push_disabled | `Stream_ids_exhausted ]) Stdlib.result;
}
val create_active_request : Request.t -> Body.Reader.t -> request_info
val create_active_stream : Dream_h2.Stream.Hpack.Encoder.t -> int -> (Stream_identifier.t -> (t, [ `Push_disabled | `Stream_ids_exhausted ]) Stdlib.result) -> active_stream
val response : ((('a, 'b) Stream.active_state, active_stream, 'c * active_stream) Stream.state, 'd, 'e) Stream.stream -> Response.t option
val response_exn : ((('a, 'b) Stream.active_state, active_stream, 'c * active_stream) Stream.state, 'd, 'e) Stream.stream -> Response.t
val send_fixed_response : ((('a, 'b) Stream.active_state, 'c, 'd) Stream.state, 'e, 'f) Stream.stream -> active_stream -> Response.t -> [< `Bigstring of Bigstringaf.t | `String of string ] -> unit
val schedule_trailers : ((('a, 'b) Stream.active_state, active_stream, 'c) Stream.state, 'd, 'e) Stream.stream -> Headers.t -> unit
val unsafe_respond_with_data : ((('a, 'b) Stream.active_state, active_stream, 'c * active_stream) Stream.state, 'd, 'e) Stream.stream -> Response.t -> [< `Bigstring of Bigstringaf.t | `String of string ] -> unit
val respond_with_string : ((('a, 'b) Stream.active_state, active_stream, 'c * active_stream) Stream.state, 'd, 'e) Stream.stream -> Response.t -> string -> unit
val respond_with_bigstring : ((('a, 'b) Stream.active_state, active_stream, 'c * active_stream) Stream.state, 'd, 'e) Stream.stream -> Response.t -> Bigstringaf.t -> unit
val send_streaming_response : flush_headers_immediately:bool -> ((('a, 'b) Stream.active_state, 'c, 'd) Stream.state, 'e, 'f) Stream.stream -> active_stream -> Response.t -> Body.Writer.t
val unsafe_respond_with_streaming : ((('a, 'b) Stream.active_state, active_stream, 'c * active_stream) Stream.state, 'd, 'e) Stream.stream -> flush_headers_immediately:bool -> Response.t -> Body.Writer.t
val respond_with_streaming : ((('a, 'b) Stream.active_state, active_stream, 'c * active_stream) Stream.state, 'd, 'e) Stream.stream -> ?flush_headers_immediately:bool -> Response.t -> Body.Writer.t
val start_push_stream : ((('a, 'b) Stream.active_state, 'c, 'd) Stream.state, 'e, 'f) Stream.stream -> active_stream -> Request.t -> (t, [ `Push_disabled | `Stream_cant_push | `Stream_ids_exhausted ]) Stdlib.result
val unsafe_push : ((('a, 'b) Stream.active_state, active_stream, 'c) Stream.state, 'd, 'e) Stream.stream -> Request.t -> (t, [ `Push_disabled | `Stream_cant_push | `Stream_ids_exhausted ]) Stdlib.result
val push : ((('a, 'b) Stream.active_state, active_stream, 'c) Stream.state, 'd, 'e) Stream.stream -> Request.t -> (t, [ `Push_disabled | `Stream_cant_push | `Stream_ids_exhausted ]) Stdlib.result
val _report_error : ?request:Request.t -> t -> active_stream -> error -> Error_code.t -> unit
val error_code : ((('a, 'b) Stream.active_state, 'c, 'd) Stream.state, [> `Exn of exn ] as 'e, 'f) Stream.stream -> 'e option
val requires_output : ((('a, 'b) Stream.active_state, active_stream, 'c) Stream.state, 'd, 'e) Stream.stream -> bool
val write_buffer_data : Dream_h2.Stream.Writer.t -> off:int -> len:int -> Dream_h2__Serialize.frame_info -> [< `Bigstring of Bigstringaf.t | `String of string ] -> unit
val close_stream : ((('a, 'b) Stream.active_state, 'c, 'd) Stream.state, 'e, 'f) Stream.stream -> unit
val flush_response_body : ((('a, 'b) Stream.active_state, active_stream, 'c) Stream.state, 'd, 'e) Stream.stream -> max_bytes:int -> int
val deliver_trailer_headers : ((('a, 'b) Stream.active_state, active_stream, 'c) Stream.state, 'd, 'e) Stream.stream -> Headers.t -> unit
OCaml

Innovation. Community. Security.