|
Hyperon C
|
Interface to define behavior moving atoms between host languages and encoding atoms to stable representations. More...
Classes | |
| struct | serial_result_t |
| The result of a serialize operation reported by serializer. More... | |
| struct | serializer_api_t |
| A table of functions to receive values encoded as specific primitive types. More... | |
Functions | |
| enum serial_result_t | atom_gnd_serialize (const atom_ref_t *atom, const struct serializer_api_t *api, void *context) |
| Serializes a grounded atom using the given serializer. | |
Interface to define behavior moving atoms between host languages and encoding atoms to stable representations.
The serialization interface provides a mechanism to move and compare equivalent implementations of grounded atoms. For example, a Python int and a Rust i64 have some overlap in meaning. This interface provides the functionality to allows one to be transformed into the other.
In addition this interface lays the groundwork to support stable encodings needed to save grounded atoms to disk or send them over a network
| enum serial_result_t atom_gnd_serialize | ( | const atom_ref_t * | atom, |
| const struct serializer_api_t * | api, | ||
| void * | context ) |
Serializes a grounded atom using the given serializer.
| [in] | atom | A pointer to an atom_t or an atom_ref_t to serialize |
| [in] | api | A table of functions the serialize implementation may call to encode the atom value |
| [in] | context | A caller-defined object to pass to functions in the api, to receive the encoded value(s) |