package dream-httpaf

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Hpack = Dream_hpack.Hpack
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 : 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 ]) result;
}
val create_active_request : Request.t -> Body.Reader.t -> request_info
val create_active_stream : Hpack.Encoder.t -> int -> (Stream_identifier.t -> (t, [ `Push_disabled | `Stream_ids_exhausted ]) result) -> active_stream
val request : t -> Request.t
val request_body : t -> Body.Reader.t
val response : t -> Response.t option
val response_exn : t -> Response.t
val send_fixed_response : t -> active_stream -> Response.t -> [< `Bigstring of Bigstringaf.t | `String of string ] -> unit
val schedule_trailers : t -> Headers.t -> unit
val unsafe_respond_with_data : t -> Response.t -> [< `Bigstring of Bigstringaf.t | `String of string ] -> unit
val respond_with_string : t -> Response.t -> string -> unit
val respond_with_bigstring : t -> Response.t -> Bigstringaf.t -> unit
val send_streaming_response : flush_headers_immediately:bool -> t -> active_stream -> Response.t -> Body.Writer.t
val unsafe_respond_with_streaming : t -> flush_headers_immediately:bool -> Response.t -> Body.Writer.t
val respond_with_streaming : t -> ?flush_headers_immediately:bool -> Response.t -> Body.Writer.t
val start_push_stream : t -> active_stream -> Request.t -> (t, [ `Push_disabled | `Stream_cant_push | `Stream_ids_exhausted ]) result
val unsafe_push : t -> Request.t -> (t, [ `Push_disabled | `Stream_cant_push | `Stream_ids_exhausted ]) result
val push : t -> Request.t -> (t, [ `Push_disabled | `Stream_cant_push | `Stream_ids_exhausted ]) result
val _report_error : ?request:Request.t -> t -> active_stream -> error -> Error_code.t -> unit
val report_error : t -> error -> Error_code.t -> unit
val report_exn : t -> exn -> unit
val try_with : t -> (unit -> 'a) -> (unit, exn) result
val error_code : ((('a, 'b) Stream.active_state, 'c, 'd) Stream.state, [> `Exn of exn ] as 'e, 'f) Stream.t -> 'e option
val requires_output : t -> bool
val flush_request_body : t -> unit
val write_buffer_data : Writer.t -> off:int -> len:int -> Dream_h2__Serialize.frame_info -> [< `Bigstring of Bigstringaf.t | `String of string ] -> unit
val close_stream : t -> unit
val flush_response_body : t -> max_bytes:int -> int
val deliver_trailer_headers : t -> Headers.t -> unit
OCaml

Innovation. Community. Security.