aboutsummaryrefslogtreecommitdiff
path: root/lib/rl.mli
blob: f5836534d33f40334a0042afe17d496b46c87e29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
open Core
open Async

module RouteMap : module type of Map.Make(String)

type rl = {
    limit: int;
    remaining: int;
    reset: int;
}

type t = ((rl, read_write) Mvar.t) RouteMap.t

val rl_of_header : Cohttp.Header.t -> rl option
val default : rl
val empty : t
val update : 'a RouteMap.t -> string -> f:('a option -> 'a) -> 'a RouteMap.t
val find : 'a RouteMap.t -> string -> 'a option
val find_exn : 'a RouteMap.t -> string -> 'a