gossamer/json

Types

A JSON value — one of null, boolean, number, string, array, or object.

pub type Json {
  Null
  Boolean(Bool)
  Number(Float)
  String(String)
  Array(List(Json))
  Object(dict.Dict(String, Json))
}

Constructors

  • Null
  • Boolean(Bool)
  • Number(Float)
  • String(String)
  • Array(List(Json))
  • Object(dict.Dict(String, Json))

Values

pub fn parse(text: String) -> Result(Json, js_error.JsError)

Parses a JSON string into a Json value. Returns an error if the string is not valid JSON.

pub fn stringify(json: Json) -> String

Serializes a Json value into a JSON string.

Search Document