use std::{any::Any, future::Future, pin::Pin, sync::Arc};
use crate::{context::AppContext, error::AppError};
pub type BoxAnySend = Box<dyn Any + Send>;
pub type HandlerFuture<'a> =
Pin<Box<dyn Future<Output = Result<BoxAnySend, AppError>> + Send + 'a>>;
pub type HandlerFn =
Arc<dyn for<'a> Fn(BoxAnySend, &'a AppContext) -> HandlerFuture<'a> + Send + Sync>;