Skip to main content

apigate_core/
hook.rs

1use std::future::Future;
2use std::pin::Pin;
3
4use crate::PartsCtx;
5use crate::error::ApigateError;
6
7pub type BeforeFuture<'a> = Pin<Box<dyn Future<Output = HookResult> + Send + 'a>>;
8pub type BeforeFn = for<'a> fn(PartsCtx<'a>) -> BeforeFuture<'a>;
9pub type HookResult = Result<(), ApigateError>;