Skip to main content

GateHooks

Trait GateHooks 

Source
pub trait GateHooks: Send + Sync {
    // Provided methods
    fn on_protected_request<'a>(
        &'a self,
        _req: &'a Request<Body>,
    ) -> impl Future<Output = ProtectedRequestOutcome> + Send + 'a { ... }
    fn on_payment_verified<'a>(
        &'a self,
        _req: &'a mut Request<Body>,
    ) -> impl Future<Output = ()> + Send + 'a { ... }
}
Available on crate feature server only.
Expand description

HTTP-layer hooks. Defaults are no-ops.

Provided Methods§

Source

fn on_protected_request<'a>( &'a self, _req: &'a Request<Body>, ) -> impl Future<Output = ProtectedRequestOutcome> + Send + 'a

Fires on every protected request, before the payment check.

Source

fn on_payment_verified<'a>( &'a self, _req: &'a mut Request<Body>, ) -> impl Future<Output = ()> + Send + 'a

Fires after a payment is verified, before the inner handler.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§