View Source YamlRustler (YamlRustler v0.1.4)

YAML parsing library using Rust's yaml-rust2 via Rustler.

Summary

Functions

Parses a YAML string and returns an Elixir data structure.

Functions

@spec parse(binary()) :: {:ok, term()} | {:error, binary()}

Parses a YAML string and returns an Elixir data structure.

Examples

iex> YamlRustler.parse("foo: bar")
{:ok, %{"foo" => "bar"}}

iex> YamlRustler.parse("invalid: : yaml")
{:error, "YAML parsing error: mapping values are not allowed in this context at byte 9 line 1 column 10"}