Skip to main content

Call

Trait Call 

Source
pub trait Call<Req, State, Res>: Send + Sync {
    // Required methods
    fn call(
        &self,
        bundle: Bundle<Req, State, Res>,
    ) -> Pin<Box<dyn Future<Output = Bundle<Req, State, Res>> + Send>>;
    fn priority(&self) -> u8;
}
Expand description

A type-erased handler callable with a whole bundle.

Required Methods§

Source

fn call( &self, bundle: Bundle<Req, State, Res>, ) -> Pin<Box<dyn Future<Output = Bundle<Req, State, Res>> + Send>>

Call the handler, returning the updated bundle.

Source

fn priority(&self) -> u8

The handler’s priority, used to sort the chain.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<Req, State, Res> Call<Req, State, Res> for AsyncHandler<Req, State, Res>
where Req: Send + 'static, State: Send + 'static, Res: Send + 'static,

Source§

impl<Req, State, Res> Call<Req, State, Res> for TowerHandler<Req, State, Res>
where Req: Send + 'static, State: Send + 'static, Res: Send + 'static,

Source§

impl<Req, SubState, Target, Res> Call<Req, Target, Res> for SyncHandler<Req, SubState, Res>
where Req: Send + 'static, SubState: Send + 'static, Target: Send + 'static + WithSubState<SubState>, Res: Send + Mul<Output = Res> + 'static,