Function simd_json::serde::from_str

source ·
pub unsafe fn from_str<'a, T>(s: &'a mut str) -> Result<T>
where T: Deserialize<'a>,
Expand description

Parses a str using a serde deserializer. note that the slice will be rewritten in the process and might not remain a valid utf8 string in its entirety.

It is recommended to use from_slice instead.

§Errors

Will return Err if s is invalid JSON.

§Safety

This function mutates the string passed into it, it’s a convenience wrapper around from_slice, holding the same guarantees as str::as_bytes_mut in that after the call &str might include invalid utf8 bytes.