HandlerResult
pub trait HandlerResult { type Error;
// Required method fn send(self) -> Result<(), Self::Error>;}Trait for supporting more flexible return types for the handler passed to Serve::run.
The types that this is implemented for by default are:
Response, for a handler that always generates a response.(), for a handler that has already called either Response::sendtoclient or Response::streamtoclient.Result<(), E>, for a handler that has already called either Response::sendtoclient or Response::streamtoclient, but might fail with an error of typeEalong the way.Result<Response, E>, for a handle the might generate a response to send or an error.
For the Result implementations, a return value containing an error will attempt to send
a 500 response status with a body containing the ToString::to_string representation of the
error, in the same way that fastly::main does.
Methods
send
View sourcePerform any remaining work to send this response downstream.
Parameters
- self: Self
Returns
Result<(), Self::Error>