snx 0.0.5

an experimental batteries-included web framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::response::{IntoResponse, Response};

/// Represents an HTML response.
pub struct Html<'a>(pub &'a str);

impl IntoResponse for Html<'_> {
    fn into_response(self) -> Response {
        let mut res = Response::new(self.0.as_bytes().to_vec());

        res.headers_mut()
            .insert("Content-Type", "text/html; charset=utf-8");

        res
    }
}