module Int:Make(Std_internal.Int)
typecontents =C.t
make ~size ~init_level
Create a new bucket. Fails if init_level is not within bounds zero;size.
level t
Get the current bucket level.
take t x
Take some exact amount out of the bucket and return `Taken. If there is not
enough left in the bucket, return `Unable.
take_at_most t x
Take some amount out of the bucket, possibly emptying it. The return value
is the amount that was actually taken out.
fill t x
Put some amount into the bucket, possibly overflowing. The return value
is the amount that was actually added to the bucket.
type t = {
|
mutable level : |
|
size : |
val bin_size_t : t -> intval bin_write_t_ : Bin_prot.Unsafe_common.sptr ->
Bin_prot.Unsafe_common.eptr -> t -> Bin_prot.Unsafe_common.sptrval bin_write_t : Bin_prot.Common.buf ->
pos:Bin_prot.Common.pos -> t -> Bin_prot.Common.posval bin_writer_t : t Bin_prot.Type_class.writerval bin_read_t__ : 'a -> 'b -> 'c -> 'dval bin_read_t_ : Bin_prot.Unsafe_common.sptr_ptr ->
Bin_prot.Unsafe_common.eptr -> tval bin_read_t : Bin_prot.Common.buf ->
pos_ref:Bin_prot.Common.pos Pervasives.ref -> tval bin_reader_t : t Bin_prot.Type_class.readerval bin_t : t Bin_prot.Type_class.t
make ~size ~init_level
Create a new bucket. Fails if init_level is not within bounds zero;size.
level t
Get the current bucket level.
take t x
Take some exact amount out of the bucket and return `Taken. If there is not
enough left in the bucket, return `Unable.
take_at_most t x
Take some amount out of the bucket, possibly emptying it. The return value
is the amount that was actually taken out.
fill t x
Put some amount into the bucket, possibly overflowing. The return value
is the amount that was actually added to the bucket.
val t_of_sexp : Sexplib.Sexp.t -> tval sexp_of_t : t -> Sexplib.Sexp.ttypesexpable =t
typebinable =t
val make : size:C.sexpable -> init_level:C.sexpable -> tval level : t -> contentsval take : t -> C.comparable -> [> `Taken | `Unable ]val take_at_most : t -> C.comparable -> C.tval fill : t -> C.comparable -> C.t