Skip to main content

Res

Trait Res 

Source
pub trait Res {
    // Required methods
    fn error_response(path: &str, err: ServerFnErrorResponseParts) -> Self;
    fn redirect(&mut self, path: &str);
}
Expand description

Represents the response as created by the server;

Required Methods§

Source

fn error_response(path: &str, err: ServerFnErrorResponseParts) -> Self

Converts an error into a response, with a 500 status code and the serialized error as its body.

Source

fn redirect(&mut self, path: &str)

Redirect the response by setting a 302 code and Location header.

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.

Implementations on Foreign Types§

Source§

impl Res for Response<Body>

Source§

fn error_response(path: &str, err: ServerFnErrorResponseParts) -> Self

Source§

fn redirect(&mut self, path: &str)

Source§

impl Res for Response<Body>

Source§

fn error_response(path: &str, err: ServerFnErrorResponseParts) -> Self

Source§

fn redirect(&mut self, path: &str)

Implementors§