use anyhow::Result;
use dyn_clone::DynClone;
use ogcapi_types::processes::{Execute, Process, Results, StatusInfo};
use serde::{Deserialize, Serialize};
#[async_trait::async_trait]
pub trait Processor: Send + Sync + DynClone {
fn id(&self) -> &'static str;
fn version(&self) -> &'static str;
fn process(&self) -> Result<Process>;
async fn execute(&self, execute: Execute) -> Result<ProcessResponseBody>;
}
dyn_clone::clone_trait_object!(Processor);
#[derive(Debug, Serialize, Deserialize)]
pub enum ProcessResponseBody {
Requested(Vec<u8>),
Results(Results),
Empty(String),
StatusInfo(StatusInfo),
}