Skip to main content

Middleware

Trait Middleware 

Source
pub trait Middleware<E> {
    type Executor: Executor;

    // Required method
    fn wrap(&self, executor: E) -> Self::Executor;
}
Expand description

A Pacta-native decorator over execution: the Tower Layer analog. Because wrap takes an Executor and returns an Executor, middleware compose arbitrarily (the closure property), which is how orchestration is composed onto the seam.

Required Associated Types§

Source

type Executor: Executor

The wrapped executor type.

Required Methods§

Source

fn wrap(&self, executor: E) -> Self::Executor

Wrap an executor with this middleware.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§