Skip to main content

to_string

Function to_string 

pub fn to_string<T>(value: &T) -> Result<String, Error>
where T: Serialize,
Expand description

Serialize a typed value to a YAML string.

ยงExamples

use noyalib::compat::serde_yaml as syml;
let s = syml::to_string(&42_i32).unwrap();
assert!(s.contains("42"));