with builder

This commit is contained in:
2022-11-22 23:12:10 +01:00
parent b7a0e0b96e
commit 367fa16fd7
12 changed files with 254 additions and 13 deletions

View File

@@ -0,0 +1,22 @@
pub mod builder_capabilities;
mod builders;
use std::{path::PathBuf, sync::Arc};
use async_trait::async_trait;
use crate::schema::models::Action;
#[async_trait]
pub trait RunnableBin {
async fn run(&self) -> eyre::Result<()>;
}
pub type DynRunnableBin = Arc<dyn RunnableBin + Send + Sync>;
#[async_trait]
pub trait Builder {
async fn build(&self, action_path: PathBuf, action: Action) -> eyre::Result<DynRunnableBin>;
}
pub type DynBuilder = Arc<dyn Builder + Send + Sync>;