Skip to main content

DynGateHooks

Trait DynGateHooks 

Source
pub trait DynGateHooks: Send + Sync {
    // Required methods
    fn on_protected_request<'a>(
        &'a self,
        req: &'a Request<Body>,
    ) -> Pin<Box<dyn Future<Output = ProtectedRequestOutcome> + Send + 'a>>;
    fn on_payment_verified<'a>(
        &'a self,
        req: &'a mut Request<Body>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>;
}
Available on crate feature server only.
Expand description

Object-safe erasure of GateHooks.

Required Methods§

Source

fn on_protected_request<'a>( &'a self, req: &'a Request<Body>, ) -> Pin<Box<dyn Future<Output = ProtectedRequestOutcome> + Send + 'a>>

Source

fn on_payment_verified<'a>( &'a self, req: &'a mut Request<Body>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> DynGateHooks for T
where T: GateHooks + ?Sized,