Skip to main content

from_slice

Function from_slice 

pub fn from_slice<T>(bytes: &[u8]) -> Result<T, Error>
where T: DeserializeOwned + 'static,
Expand description

Deserialize a YAML document from a byte slice.

ยงExamples

use noyalib::compat::serde_yaml as syml;
let n: i32 = syml::from_slice(b"7").unwrap();
assert_eq!(n, 7);