HandlerResult

Traitin servefastly 0.13.1View source
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:

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

fn send(self) -> Result<(), Self::Error>

Perform any remaining work to send this response downstream.

Parameters

self: Self

Returns

Result<(), Self::Error>