pub fn to_string_multiple<T: Serialize>(values: &[T]) -> Result<String, Error>
Expand description
Serialize multiple documents into a YAML string.
Serializes each value in the provided slice as an individual YAML document. Documents are separated by a standard YAML document start marker (āā\nā). No marker is emitted before the first document.
Example
use serde::Serialize;
#[derive(Serialize)]
struct Point { x: i32 }
let docs = vec![Point { x: 1 }, Point { x: 2 }];
let out = serde_saphyr::to_string_multiple(&docs).unwrap();
assert_eq!(out, "x: 1\n---\nx: 2\n");