anza 0.6.0

Ultra-lightweight, zero-copy, cryptographically verified Server-Templated UI (STUI) engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[cfg(feature = "actix")]
use {
  crate::models::document::Document,
  actix_web::{body::BoxBody, http::header::ContentType, HttpResponse, Responder},
};

#[cfg(feature = "actix")]
impl Responder for Document {
  type Body = BoxBody;

  fn respond_to(self, _req: &actix_web::HttpRequest) -> HttpResponse<Self::Body> {
    HttpResponse::Ok()
      .content_type(ContentType::html())
      .body(self.html)
  }
}