from_str

Function from_str 

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

Deserialize JSON from a UTF-8 string slice into an owned type.

This is the recommended default for most use cases. The input does not need to outlive the result, making it suitable for deserializing from temporary buffers (e.g., HTTP request bodies).

Types containing &str fields cannot be deserialized with this function; use String or Cow<str> instead. For zero-copy deserialization into borrowed types, use from_str_borrowed.

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