/libyaml-rust

LibYAML bindings for Rust

Primary LanguageRustMIT LicenseMIT

libyaml-rust

libyaml-rust on Travis CI

LibYAML bindings for Rust

Dependencies

  • LibYAML 0.1.4 or higher
  • Latest Rust compiler (0.11-pre)

Usage

Parse from memory

extern crate yaml;

use yaml::constructor::*;

yaml::parse_bytes_utf8("[1, 2, 3]".as_bytes()); // => Ok(vec![YamlSequence(~[YamlInteger(1), YamlInteger(2), YamlInteger(3)])])

Parse from Reader

extern crate yaml;

use std::io::BufReader;
use yaml::constructor::*;

let data = "[1, 2, 3]";
let mut reader = BufReader::new(data.as_bytes());

yaml::parse_io_utf8(&mut reader); // => Ok(vec![YamlSequence(~[YamlInteger(1), YamlInteger(2), YamlInteger(3)])])

Todo

In the order of what I want to do...