use axum::http::status::StatusCode;
use axum::response::IntoResponse;
use axum::response::Json;
use axum::response::Response;
use serde::Serialize;
use crate::HumusFormat;
use crate::HumusQuerySettings;
pub trait HumusView<S, F>: Serialize + Sized
where
S: HumusQuerySettings<F>,
F: HumusFormat,
{
fn get_template_name(&self) -> String;
fn get_status_code(&self, settings: &S) -> StatusCode;
#[cfg(feature = "axum-view+cookie")]
fn get_cookie_header(&self, _settings: &S) -> Option<String> {
None
}
fn update_response(&self, _response: &mut Response, _settings: &S) {}
fn get_api_response(self, _settings: &S) -> Response {
Json(self).into_response()
}
}