/// An HTTP error returned from a handler or middleware; the server converts it to a plain-text response.
pubstructHttpError{/// HTTP status code sent to the client.
pubstatus:u16,
/// Error message sent as the response body.
pubmessage: String,
}implHttpError{/// Creates an error with status `500` and the given message.
pubfnnew(msg: impl Into<String>)->Self{Self{
status:500,
message: msg.into(),}}/// Overrides the HTTP status code.
pubfnstatus(mutself, status:u16)->Self{self.status = status;self}}