from_slice_borrowed

Function from_slice_borrowed 

Source
pub fn from_slice_borrowed<'input, 'facet, T: Facet<'facet>>(
    input: &'input [u8],
) -> Result<T, JsonError>
where 'input: 'facet,
Expand description

Deserialize JSON from a byte slice, allowing zero-copy borrowing.

This variant requires the input to outlive the result ('input: 'facet), enabling zero-copy deserialization of string fields as &str.

Use this when you need maximum performance and can guarantee the input buffer outlives the deserialized value. For most use cases, prefer from_slice which doesn’t have lifetime requirements.

Note: For rich error diagnostics with source code display, prefer from_str_borrowed which can attach the source string to errors.