Skip to main content

RouteOutput

Trait RouteOutput 

Source
pub trait RouteOutput: Send + 'static {
    const PREVIEW_AWARE: bool;

    // Required method
    fn into_preview_decision(self) -> HandlerResult<PreviewDecision>;
}
Expand description

Return type adapter for route handlers.

Handlers returning HandlerResult<Response> keep the full-body behavior: the server reads the whole request body before invoking them. Handlers returning HandlerResult<PreviewDecision> are preview-aware and may be invoked before 100 Continue. If a preview-aware handler returns PreviewDecision::Continue, the server sends 100 Continue, reads the remainder, and invokes the same route again with Body::Full.

Required Associated Constants§

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§