Module Bin_ser.Encoder_state

type t = encoder_state
val make : unit -> t
val get_or_def_id : t -> local:bool -> Uid.t -> int

Map the given Uid to an integer.

parameter local

if true, the ID is allowed to be a local variable, otherwise it must have a properly defined chash

val get_or_def : t -> (_'a) Key.t -> 'a -> int

Map the given value to an integer using the given key.

val find_id : t -> Uid.t -> int
raises Not_found

if not present

val drain_side_defs : t -> M.t iter

Iterate on side definitions between integers and encoded objects, and purge them.

val drain_side_defs_l : t -> M.t list

Iterate on side definitions between integers and encoded objects, and purge them.