Skip to main content

to_string

Function to_string 

Source
pub fn to_string<T>(value: &T) -> Result<String>
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"));