simd_json::serde

Function from_str_with_buffers

Source
pub unsafe fn from_str_with_buffers<'a, T>(
    s: &'a mut str,
    buffers: &mut Buffers,
) -> 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_with_buffers instead.

Passes in reusable buffers to reduce allocations.

§Errors

Will return Err if s is invalid JSON.

§Safety

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