sfr-server 0.1.2

The server implementation for a Slack App.
Documentation
//! The response to get home page.

use crate::response::CT_TEXT_HTML;
use axum::body::Body;
use axum::http::Response;
use axum::response::IntoResponse;

/// The response to get home page.
///
/// TODO: Support stream.
pub struct GetHomeResponse(Vec<u8>);

impl GetHomeResponse {
    /// The constructor.
    pub fn new(inner: Vec<u8>) -> Self {
        Self(inner)
    }
}

impl From<Vec<u8>> for GetHomeResponse {
    fn from(inner: Vec<u8>) -> Self {
        Self(inner)
    }
}

impl IntoResponse for GetHomeResponse {
    fn into_response(self) -> Response<Body> {
        ([CT_TEXT_HTML], self.0).into_response()
    }
}