syt
This crate provides "things" for [serde_yml] or "serde_yml" things. It is mostly a bunch of hacks consisting of the following:
- Functions to append YAML documents to a YAML file.
- An iterator to lazy load multiple YAML docs from the same file.
- A writer that inserts YAML comments based on a callback.
Example of appending and lazy load YAML docs
use Write;
use NamedTempFile;
use Deserialize;
use Serialize;
use LazyDocs;
use Error;
use append_or_new;
/// Example Docs
Example of adding comments to YAML docs.
use Serialize;
use ;
let config = Config ;
let cb = ;
let result = to_string.unwrap;
let expected = "\
## The name of the person.\n\
name: John Doe\n\
## The age of the person.\n\
## In years.\n\
age: 30\n\
"
.trim_start
.to_string;
assert_eq!;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.