package dream-httpaf

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Httpaf = Dream_httpaf_.Httpaf
module Hpack = Dream_hpack.Hpack
module AB = Angstrom.Buffered
module Reader = Parse.Reader
module Writer = Serialize.Writer
module Scheduler : sig ... end
type request_handler = Reqd.t -> unit
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 t = {
  1. mutable settings : Settings.t;
  2. reader : Reader.frame;
  3. writer : Writer.t;
  4. config : Config.t;
  5. request_handler : request_handler;
  6. error_handler : error_handler;
  7. streams : Scheduler.t;
  8. mutable current_client_streams : int;
  9. mutable max_client_stream_id : Stream_identifier.t;
  10. mutable max_pushed_stream_id : Stream_identifier.t;
  11. mutable receiving_headers_for_stream : Stream_identifier.t option;
  12. mutable unacked_settings : int;
  13. mutable did_send_go_away : bool;
  14. hpack_encoder : Hpack.Encoder.t;
  15. hpack_decoder : Hpack.Decoder.t;
}
val is_closed : t -> bool
val wakeup_writer : t -> unit
val shutdown_reader : t -> unit
val shutdown_writer : t -> unit
val shutdown : t -> unit
val was_closed_or_implicitly_closed : t -> Stdlib.Int32.t -> bool
val report_error : t -> Error.t -> unit
val report_connection_error : t -> ?reason:string -> Error_code.t -> unit
val report_stream_error : t -> Stream_identifier.t -> Error_code.t -> unit
val set_error_and_handle : ?request:'a -> t -> Reqd.t -> Reqd.error -> Error_code.t -> unit
val report_exn : t -> exn -> unit
val on_close_stream : t -> Stream_identifier.t -> active:bool -> Stream.closed -> unit
val send_window_update : 'a. t -> 'a Scheduler.PriorityTreeNode.node -> int32 -> unit
val create_push_stream : t -> Stream_identifier.t -> ((((Reqd.request_info, Reqd.request_info) Stream.active_state, Reqd.active_stream, Reqd.request_info * Reqd.active_stream) Stream.state, Reqd.error, error_handler) Stream.t, [> `Push_disabled | `Stream_ids_exhausted ]) Stdlib.result
val handle_headers : t -> end_stream:bool -> Scheduler.nonroot Scheduler.node -> Reqd.active_stream -> Headers.header list -> unit
val handle_headers_block : t -> ?is_trailers:bool -> Scheduler.nonroot Scheduler.node -> Reqd.active_stream -> Stream.partial_headers -> int -> Angstrom.bigstring -> unit
val handle_trailer_headers : t -> Scheduler.nonroot Scheduler.node -> Reqd.active_stream -> Stream.partial_headers -> int -> Angstrom.bigstring -> unit
val open_stream : t -> priority:Priority.t -> Stdlib.Int32.t -> Scheduler.nonroot Scheduler.node option
val process_first_headers_block : t -> Frame.frame_header -> Scheduler.nonroot Scheduler.node -> Bigstringaf.t -> unit
val process_trailer_headers : t -> Scheduler.nonroot Scheduler.node -> Reqd.active_stream -> Frame.frame_header -> Angstrom.bigstring -> unit
val process_headers_frame : t -> Frame.t -> priority:Priority.t -> Bigstringaf.t -> unit
val process_data_frame : t -> Frame.t -> Bigstringaf.t -> unit
val process_priority_frame : t -> Frame.t -> Priority.t -> unit
val process_rst_stream_frame : t -> Frame.t -> Error_code.t -> unit
val apply_settings_list : t -> Settings.setting list -> unit
val write_settings_frame : t -> ack:bool -> Settings.setting list -> unit
val process_settings_frame : t -> Frame.t -> Settings.setting list -> unit
val process_ping_frame : t -> Frame.t -> Faraday.bigstring -> unit
val process_goaway_frame : t -> 'a -> last_stream_id:'b -> data:Bigstringaf.t -> Error_code.t -> unit
val add_window_increment : 'a. t -> 'a Scheduler.PriorityTreeNode.node -> int32 -> unit
val process_window_update_frame : t -> Frame.t -> int32 -> unit
val process_continuation_frame : t -> Frame.t -> Angstrom.bigstring -> unit
val default_error_handler : ?request:'a -> [< `Bad_gateway | `Bad_request | `Conflict | `Enhance_your_calm | `Exn of exn | `Expectation_failed | `Forbidden | `Gateway_timeout | `Gone | `Http_version_not_supported | `I_m_a_teapot | `Internal_server_error | `Length_required | `Method_not_allowed | `Misdirected_request | `Network_authentication_required | `Not_acceptable | `Not_found | `Not_implemented | `Payload_too_large | `Payment_required | `Precondition_failed | `Precondition_required | `Proxy_authentication_required | `Range_not_satisfiable | `Request_header_fields_too_large | `Request_timeout | `Service_unavailable | `Too_many_requests | `Unauthorized | `Unsupported_media_type | `Upgrade_required | `Uri_too_long ] -> (Headers.t -> Body.Writer.t) -> unit
val write_connection_preface : t -> unit
val create_generic : h2c:bool -> config:Config.t -> error_handler:error_handler -> request_handler -> t
val create : ?config:Config.t -> ?error_handler:error_handler -> request_handler -> t
val handle_h2c_request : t -> Headers.header list -> Faraday.bigstring Httpaf.IOVec.t list -> unit
val create_h2c : ?config:Config.t -> ?error_handler:error_handler -> http_request:Httpaf.Request.t -> ?request_body:Faraday.bigstring Httpaf.IOVec.t list -> request_handler -> (t, string) Stdlib.result
val next_read_operation : t -> [> `Close | `Read ]
val read : t -> Bigstringaf.t -> off:int -> len:int -> int
val read_eof : t -> Bigstringaf.t -> off:int -> len:int -> int
val yield_reader : 'a -> (unit -> 'b) -> 'b
val next_write_operation : t -> [> `Close of int | `Write of Faraday.bigstring Faraday.iovec list | `Yield ]
val report_write_result : t -> [< `Closed | `Ok of int ] -> unit
val yield_writer : t -> (unit -> unit) -> unit
OCaml

Innovation. Community. Security.