module Float:Make
(
Float
)
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 -> int
val bin_write_t_ : Bin_prot.Unsafe_common.sptr ->
Bin_prot.Unsafe_common.eptr -> t -> Bin_prot.Unsafe_common.sptr
val bin_write_t : Bin_prot.Common.buf ->
pos:Bin_prot.Common.pos -> t -> Bin_prot.Common.pos
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_read_t__ : 'a -> 'b -> 'c -> 'd
val bin_read_t_ : Bin_prot.Unsafe_common.sptr_ptr ->
Bin_prot.Unsafe_common.eptr -> t
val bin_read_t : Bin_prot.Common.buf ->
pos_ref:Bin_prot.Common.pos Pervasives.ref -> t
val bin_reader_t : t Bin_prot.Type_class.reader
val 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 -> t
val sexp_of_t : t -> Sexplib.Sexp.t
typesexpable =
t
typebinable =
t
val make : size:C.sexpable -> init_level:C.sexpable -> t
val level : t -> contents
val take : t -> C.comparable -> [> `Taken | `Unable ]
val take_at_most : t -> C.comparable -> C.t
val fill : t -> C.comparable -> C.t