Module 10-Poldercast.Sub
include P2p.S.SUBSCRIPTION
val empty : 'a t
empty
returns the empty subscription set.
val length : 'a t -> int
length t
returns the number of groups in the subscription set.
val is_empty : 'a t -> bool
is_empty t
returns true if the subscription set is empty.
val find : gid -> 'a t -> (group * 'a) option
find gid t
returnsSome group
ifgid
is in the subscription set, otherwiseNone
.
val filter : (gid -> (group * 'a) -> bool) -> 'a t -> 'a t
val fold : (gid -> (group * 'a) -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (gid -> (group * 'a) -> unit) -> 'a t -> unit
val map : (gid -> (group * 'a) -> group * 'a) -> 'a t -> 'a t
val to_list : 'a t -> (group * 'a) list
to_list t
returns the subscription set as list ordered by group ID.
val init : int -> 'a t
int max_subs
initializes an empty subscription set withmax_subs
maximum number of subscriptions expected.
val of_list : int -> (group * 'a) list -> 'a t
of_list max_subs sub_list
initializes a subscription set from a list of (group, metadata) pairs
val bloom : 'a t -> Bitv.t
bloom t
returns a bloom filter with the subscribed group IDs inserted.
val blip : 'a t -> float -> Bitv.t
blip t e
isbloom
with independent random bit flips.- parameter e
Differential privacy parameter ε. Determines the privacy-utility trade-off. See
Blip
.p in the documentation of theBlip
module.