Expand description
Data conversion between greptime’s StructType and Json
The idea of this module is to provide utilities to convert serde_json::Value to greptime’s StructType and vice versa.
The struct will carry all the fields of the Json object. We will not flatten any json object in this implementation.
Structs§
- Json
Context - Context for JSON encoding/decoding that tracks the current key path
Enums§
- Json
Structure Settings - The configuration of JSON encoding
Functions§
- decode_
list_ 🔒with_ context - Decode a list value to JSON array
- decode_
list_ 🔒with_ settings - Decode a ListValue that was encoded with current settings back into a fully structured ListValue
- decode_
primitive_ 🔒value - Decode primitive value to JSON
- decode_
struct_ 🔒with_ context - Decode a structured value to JSON object
- decode_
struct_ 🔒with_ settings - Decode a StructValue that was encoded with current settings back into a fully structured StructValue
- decode_
unstructured_ 🔒raw_ struct - Helper function to decode a struct that was encoded with UnstructuredRaw settings
- decode_
unstructured_ 🔒value - Decode unstructured value (stored as string)
- decode_
value_ with_ context - Main decoding function with key path tracking
- encode_
json_ 🔒array_ with_ context - encode_
json_ 🔒object_ with_ context - encode_
json_ 🔒value_ with_ context - Helper function to encode a JSON value to a Value and determine its ConcreteDataType with context
- encode_
json_ with_ context - Main encoding function with key path tracking
- try_
convert_ 🔒to_ expected_ type - Helper function to try converting a value to an expected type