mote/toml

Types

pub type GetError {
  NotFound
  InvalidValue
}

Constructors

  • NotFound
  • InvalidValue
pub type MaybeNumber {
  Integer(Int)
  Floating(Float)
  Nan
  Infinity
  NegativeInfinity
}

Constructors

  • Integer(Int)
  • Floating(Float)
  • Nan
  • Infinity
  • NegativeInfinity
pub external type ReturnTerm
pub type Section =
  map.Map(BitString, Value)
pub external type SemanticError
pub type TomlError {
  Tokenize(Int)
  Parse(Int)
  Semantic(SemanticError)
  BadReturn(ValidateLocation, ReturnTerm)
}

Constructors

  • Tokenize(Int)
  • Parse(Int)
  • Semantic(SemanticError)
  • BadReturn(ValidateLocation, ReturnTerm)
pub external type ValidateLocation
pub type Value {
  MaybeNumber(MaybeNumber)
  Binary(BitString)
  Boolean(Bool)
  ValueList(List(Value))
  Table(Section)
}

Constructors

  • MaybeNumber(MaybeNumber)
  • Binary(BitString)
  • Boolean(Bool)
  • ValueList(List(Value))
  • Table(Section)

Functions

pub fn get(section: Map(BitString, Value), path: List(String)) -> Result(
  Value,
  GetError,
)
pub fn get_string(section: Map(BitString, Value), path: List(
    String,
  )) -> Result(String, GetError)
pub external fn parse(String) -> Result(Section, TomlError)
Search Document