diff options
| author | Adelyn Breelove <[email protected]> | 2019-01-21 12:14:58 -0700 |
|---|---|---|
| committer | Adelyn Breelove <[email protected]> | 2019-01-21 12:14:58 -0700 |
| commit | ef93c7448f6c74ec20bd7846cb324b836bb2e222 (patch) | |
| tree | 5ed470e09b45279a07202ea22d62dc9ef2935724 /lib/rl.mli | |
| parent | Finalize signatures (diff) | |
| download | disml-ef93c7448f6c74ec20bd7846cb324b836bb2e222.tar.xz disml-ef93c7448f6c74ec20bd7846cb324b836bb2e222.zip | |
More signature improvements
Diffstat (limited to 'lib/rl.mli')
| -rw-r--r-- | lib/rl.mli | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1,19 +1,37 @@ +(** Internal ratelimit route mapping. *) + open Core open Async +(** Type for mapping route -> {!rl}. *) module RouteMap : module type of Map.Make(String) +(** Type representing ratelimit information. *) type rl = { limit: int; remaining: int; reset: int; } +(** Type representing the specific case of {!RouteMap}. *) type t = ((rl, read_write) Mvar.t) RouteMap.t +(** Converts Cohttp header data into ratelimit information. + @return Some of ratelimit information or None on bad headers +*) val rl_of_header : Cohttp.Header.t -> rl option + +(** Default for type rl. Used for prepopulating routes. *) val default : rl + +(** Empty ratelimit route map. *) val empty : t + +(** Analogous to {!RouteMap.update}. *) val update : 'a RouteMap.t -> string -> f:('a option -> 'a) -> 'a RouteMap.t + +(** Analogous to {!RouteMap.find}. *) val find : 'a RouteMap.t -> string -> 'a option + +(** Analogous to {!RouteMap.find_exn}. *) val find_exn : 'a RouteMap.t -> string -> 'a
\ No newline at end of file |