api

api.ch

Declarations in api.ch

2 declarationsjson

Declarations

Public only
json#
Publicnamespace
namespace json
JsonParseError#
Publicstruct
struct JsonParseError { var pos : size_t var message : string }
delete#
function
func delete(self : *JsonParseError) : void
parse#
Publicfunction
func parse(text : string_view) : Result<JsonValue, JsonParseError>
parse JSON text into a JsonValue tree
stringify#
Publicfunction
func stringify(value : &JsonValue) : string
serialize a JsonValue to compact JSON text
stringify_pretty#
Publicfunction
func stringify_pretty(value : &JsonValue) : string
serialize a JsonValue to pretty-printed JSON text
encode#
Publicfunction
func encode<T>(value : &T) : Result<string, SerializationError>
typed encode: serialize any Serializer type (including #json structs) to JSON text
__new_counts#
Publicfunction
func __new_counts() : vector<u64>
non-generic helpers: create the encoder state outside generic functions -
__new_encoder#
Publicfunction
func __new_encoder(buffer : &string, counts : &vector<u64>) : JsonEncoder
decode#
Publicfunction
func decode<T>(value : &JsonValue) : Result<T, SerializationError>
typed decode: deserialize any Deserializer type (including #json structs) from a JsonValue
decode_str#
Publicfunction
func decode_str<T>(text : string_view) : Result<T, SerializationError>
parse + typed decode in one call:
__try_parse#
Publicfunction
func __try_parse(text : string_view) : Option<JsonValue>
non-generic parse helper used by json::decode_str: parses the text and moves