glitr_convert

Types

pub type GlitrType {
  String
  Bool
  Float
  Int
  Null
  List(of: GlitrType)
  Dict(key: GlitrType, value: GlitrType)
  Object(fields: List(#(String, GlitrType)))
  Optional(of: GlitrType)
  Result(result: GlitrType, error: GlitrType)
  Enum(variants: List(#(String, GlitrType)))
}

Constructors

  • String
  • Bool
  • Float
  • Int
  • Null
  • List(of: GlitrType)
  • Dict(key: GlitrType, value: GlitrType)
  • Object(fields: List(#(String, GlitrType)))
  • Optional(of: GlitrType)
  • Result(result: GlitrType, error: GlitrType)
  • Enum(variants: List(#(String, GlitrType)))
pub type GlitrValue {
  StringValue(value: String)
  BoolValue(value: Bool)
  FloatValue(value: Float)
  IntValue(value: Int)
  NullValue
  ListValue(value: List(GlitrValue))
  DictValue(value: dict.Dict(GlitrValue, GlitrValue))
  ObjectValue(value: List(#(String, GlitrValue)))
  OptionalValue(value: option.Option(GlitrValue))
  ResultValue(value: Result(GlitrValue, GlitrValue))
  EnumValue(variant: String, value: GlitrValue)
}

Constructors

  • StringValue(value: String)
  • BoolValue(value: Bool)
  • FloatValue(value: Float)
  • IntValue(value: Int)
  • NullValue
  • ListValue(value: List(GlitrValue))
  • DictValue(value: dict.Dict(GlitrValue, GlitrValue))
  • ObjectValue(value: List(#(String, GlitrValue)))
  • OptionalValue(value: option.Option(GlitrValue))
  • ResultValue(value: Result(GlitrValue, GlitrValue))
  • EnumValue(variant: String, value: GlitrValue)

Functions

pub fn json_decode(
  of: GlitrType,
) -> fn(Dynamic) -> Result(GlitrValue, List(DecodeError))
pub fn json_encode(val: GlitrValue) -> Json
Search Document