package provider

  1. Overview
  2. Docs

Displaying debugging information about a trait.

This module provides a way to register, retrieve and display detailed information about a Trait, which can be useful for debugging and understanding the structure and behavior of the provider system.

This is meant for debugging purposes only.

type t

A t value includes a unique runtime id for the trait, as well as an optional name that may be registered by the user. The id is not shown by sexp_of_t by default because its value can be brittle (it may depend on the order in which modules are evaluated). To display ids, see sexp_of_id.

val sexp_of_t : t -> Sexplib0.Sexp.t
val sexp_of_id : (int -> Sexplib0.Sexp.t) ref

Controls whether the runtime ids are shown or hidden in the sexp built by sexp_of_t. By default Fn.const (Sexp.Atom "#id"). You may temporarily change it, e.g. in a test, for example using Ref.set_temporarily.

val register_name : (_, _, _) Provider__.Trait0.t -> name:string -> unit

Register a string mnemonic to attach to the trait for display purposes. By default, trait do not have any name.

OCaml

Innovation. Community. Security.