Skip to main content

ResponseExt

Trait ResponseExt 

Source
pub trait ResponseExt {
    // Required methods
    fn status(self, code: u16) -> Self;
    fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self;
}
Expand description

Extension trait for Response to enable method chaining on macros

Required Methods§

Source

fn status(self, code: u16) -> Self

Set the HTTP status code.

Source

fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self

Set a response header, replacing any existing header with the same name (case-insensitive).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§