pub async fn write_json_response<T: Serialize + Send>(
resp: &mut dyn IHttpResponse,
value: &T,
) -> Result<()>Expand description
Helper: build a JSON response by serializing a value and writing it.
A serialization failure is a server-side defect in the response DTO, so it
surfaces as Error::ResponseSerialization
(500), not the request-parse
Error::Serialization (400).