phs/repositories.rs
1use std::collections::HashMap;
2use std::future::Future;
3use std::pin::Pin;
4use std::sync::Arc;
5use valu3::value::Value;
6
7pub type Function = Arc<dyn Fn(Value) -> Pin<Box<dyn Future<Output = Value> + Send>> + Send + Sync>;
8
9#[derive(Clone)]
10pub struct RepositoryFunction {
11 pub function: Function,
12 pub abstration: String,
13 pub args: Vec<String>,
14}
15
16#[derive(Clone)]
17pub struct Repositories {
18 pub repositories: HashMap<String, RepositoryFunction>,
19}