use std::error::Error; use std::pin::Pin; pub use atelier::rusqlite_thread_pool::PoolSender as DbS; pub type Request = axum::extract::Request; pub struct RequestCtx { pub dbs: DbS, pub path_params: atelier::router::PathParams, } pub type Response = axum::response::Response; pub type Handler = Box< dyn Fn( Request, RequestCtx, ) -> Pin + Send + 'static>> + Send + Sync + 'static, >; pub type Router = atelier::router::Router; pub type AnyError = Box; pub type Result = core::result::Result; pub use axum::response::IntoResponse; pub enum HandlerError { InternalServerError(AnyError), } impl From for HandlerError where E: Error + Send + Sync + 'static, { fn from(v: E) -> Self { Self::InternalServerError(Box::new(v)) } } impl IntoResponse for HandlerError { fn into_response(self) -> Response { "".into_response() } } pub type HandlerResult = core::result::Result; pub use crate::templates::{template_fn, Template, TemplateFn}; pub use core::fmt::{Display, Formatter}; pub type FmtResult = core::fmt::Result; pub use axum::response::Html;