pub trait IntoResponse {
    // Required method
    fn into_response(self) -> Response<Body>;
}
Expand description

A conversion of self into a Response

Implementations for Response<B> where B: Into<Body>, B where B: Into<Body> and serde_json::Value are provided by default

example

use vercel_runtime::{Body, IntoResponse, Response};

assert_eq!(
  "hello".into_response().body(),
  Response::new(Body::from("hello")).body()
);

Required Methods§

source

fn into_response(self) -> Response<Body>

Return a translation of self into a Response<Body>

Implementations on Foreign Types§

source§

impl IntoResponse for Value

source§

impl<B> IntoResponse for Response<B>where B: Into<Body>,

Implementors§

source§

impl<B> IntoResponse for Bwhere B: Into<Body>,