cairo_lang_sierra::debug_info

Type Alias Annotations

Source
pub type Annotations = OrderedHashMap<String, Value>;
Expand description

Store for non-crucial information about the program, for use by external libraries and tool.

Keys represent tool namespaces, and values are tool-specific annotations themselves. Annotation values are JSON values, so they can be arbitrarily complex.

§Namespaces

In order to avoid collisions between tools, namespaces should be URL-like, contain tool name. It is not required for namespace URLs to exist, but it is preferable nonetheless.

A single tool might want to use multiple namespaces, for example to group together annotations coming from different subcomponents of the tool. In such case, namespaces should use path-like notation (e.g. example.com/sub-namespace).

For future-proofing, it might be a good idea to version namespaces, e.g. example.com/v1.

§Example well-formed namespaces

  • scarb.swmansion.com
  • scarb.swmansion.com/v1
  • scarb.swmansion.com/build-info/v1

Aliased Type§

struct Annotations(/* private fields */);