hypershell_components/providers/
call.rs1use core::marker::PhantomData;
2
3use cgp::extra::handler::{CanHandle, Handler, HandlerComponent};
4use cgp::prelude::*;
5
6#[cgp_new_provider]
7impl<Context, OutCode, InCode, Input> Handler<Context, OutCode, Input> for Call<InCode>
8where
9 Context: CanHandle<InCode, Input>,
10 InCode: Send,
11 OutCode: Send,
12 Input: Send,
13{
14 type Output = Context::Output;
15
16 async fn handle(
17 context: &Context,
18 _tag: PhantomData<OutCode>,
19 input: Input,
20 ) -> Result<Context::Output, Context::Error> {
21 context.handle(PhantomData, input).await
22 }
23}