from_str_borrowed

Function from_str_borrowed 

Source
pub fn from_str_borrowed<'input, 'facet, T: Facet<'facet>>(
    input: &'input str,
) -> Result<T, JsonError>
where 'input: 'facet,
Expand description

Deserialize JSON from a UTF-8 string 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_str which doesn’t have lifetime requirements.

Errors from this function include source code context for rich diagnostic display when using miette’s reporting features.