simplejson/jsonvalue

Types

pub type JsonPathError {
  ParseError(context: String)
  MissingRoot
  IndexOutOfRange(i: Int)
  NoMatch
  FunctionError
  ComparisonError
  InvalidJsonPath
  PathNotFound
}

Constructors

  • ParseError(context: String)
  • MissingRoot
  • IndexOutOfRange(i: Int)
  • NoMatch
  • FunctionError
  • ComparisonError
  • InvalidJsonPath
  • PathNotFound

Type that wraps all JSON value types

pub type JsonValue {
  JsonString(str: String)
  JsonNumber(
    int: option.Option(Int),
    float: option.Option(Float),
    original: option.Option(String),
  )
  JsonBool(bool: Bool)
  JsonNull
  JsonArray(dict.Dict(Int, JsonValue))
  JsonObject(dict.Dict(String, JsonValue))
}

Constructors

  • JsonString(str: String)

    Wraps a string value

  • JsonNumber(
      int: option.Option(Int),
      float: option.Option(Float),
      original: option.Option(String),
    )

    Wraps a number value and stores an int or float depending on the input type. Also the original is stored as a String if the JSON has been parsed from text

  • JsonBool(bool: Bool)

    Wraps a boolean value

  • JsonNull

    Indicates a null value

  • JsonArray(dict.Dict(Int, JsonValue))

    Wraps an array value

  • JsonObject(dict.Dict(String, JsonValue))

    Wraps an object value

pub type ParseError {
  UnexpectedCharacter(char: String, context: String, pos: Int)
  Unknown
  UnexpectedEnd
  InvalidEscapeCharacter(char: String, context: String, pos: Int)
  InvalidCharacter(char: String, context: String, pos: Int)
  InvalidHex(hex: String, context: String, pos: Int)
  InvalidNumber(num: String, context: String, pos: Int)
  NestingDepth(num_levels: Int)
  InvalidInt(int: String)
  InvalidFloat(float: String)
}

Constructors

  • UnexpectedCharacter(char: String, context: String, pos: Int)
  • Unknown
  • UnexpectedEnd
  • InvalidEscapeCharacter(char: String, context: String, pos: Int)
  • InvalidCharacter(char: String, context: String, pos: Int)
  • InvalidHex(hex: String, context: String, pos: Int)
  • InvalidNumber(num: String, context: String, pos: Int)
  • NestingDepth(num_levels: Int)
  • InvalidInt(int: String)
  • InvalidFloat(float: String)
Search Document