pforge_runtime/handlers/
wrappers.rs

1// Handler trait implementations for CLI and HTTP handlers
2use crate::handlers::cli::{CliHandler, CliInput, CliOutput};
3use crate::handlers::http::{HttpHandler, HttpInput, HttpOutput};
4use crate::{Error, Handler, Result};
5use async_trait::async_trait;
6
7// CLI Handler Wrapper
8#[async_trait]
9impl Handler for CliHandler {
10    type Input = CliInput;
11    type Output = CliOutput;
12    type Error = Error;
13
14    async fn handle(&self, input: Self::Input) -> Result<Self::Output> {
15        self.execute(input).await
16    }
17}
18
19// HTTP Handler Wrapper
20#[async_trait]
21impl Handler for HttpHandler {
22    type Input = HttpInput;
23    type Output = HttpOutput;
24    type Error = Error;
25
26    async fn handle(&self, input: Self::Input) -> Result<Self::Output> {
27        self.execute(input).await
28    }
29}