gc_value

Generic value type, capturing the data model of common formats such as JSON, YAML and CBOR, based on Arc for cheap cloning.


License
W3C

Documentation

GcValue

GcValue (for Garbage-collected Value) is a generic value type, capturing the data model of common formats such as JSON, YAML, CBOR, and the INFRA API.

It uses Arc for cheap cloning, mimicking the assumptions of garbage-collected language (such as Javascript).

It also supports serialization/deserialization via serde.

Motivation

This crate was created for implementing algorithms from W3C specifications, many of which use INFRA as the underlying data model, and are written assuming a garbage-collected language.

The corresponding value types in format-specific crates (i.e. serde_json::Value) are not entirely suited, as they favor mutability over cheap cloning.