satex-core 0.4.0

Satex Core Library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use http::{Response, StatusCode};

pub trait ResponseExt<B>: Sized {
    fn with_status(self, status: StatusCode) -> Self;
    fn with_body(self, body: B) -> Self;
}

impl<B> ResponseExt<B> for Response<B> {
    fn with_status(mut self, status: StatusCode) -> Self {
        *self.status_mut() = status;
        self
    }

    fn with_body(mut self, body: B) -> Response<B> {
        *self.body_mut() = body;
        self
    }
}