pub async fn respond_response(
respond: &Respond,
dir_prefix: &str,
parsed_request: &ParsedRequest,
) -> Result<Response<BoxBody>, Error>Expand description
Produce the HTTP response for a matched Respond declaration.
§Why the branches are ordered file → text → status → error
The fields are mutually specialised:
file_pathserves a file (possibly with CSV→JSON conversion).text+statusyields a custom-status text response.textalone yields a plain 200 text response.statusalone yields an empty body with that status.
Respond::validate rejects nonsensical combinations at startup, so
hitting the final Err branch means something slipped past
validation — a real bug, not user input.