IntoResponse

683757
2021/12/09 05:20:05

从 0.4 开始,实现IntoResponse不需要BodyBodyError

0.2~0.3 版本

impl IntoResponse for AppError {
    type Body = Full<Bytes>;
    type BodyError = Infallible;

    fn into_response(self) -> axum::http::Response<Self::Body> {
        self.message.into_response()
    }
}

0.4 版本