1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mod include;
mod state;
mod value;

use std::sync::Arc;

pub use async_trait::async_trait;
pub use include::IncludeAdaptor;
pub use state::WildDocState;
pub use value::{Vars, VarsStack, WildDocValue};

pub use anyhow;
pub use serde_json;

use anyhow::Result;

#[async_trait(?Send)]
pub trait WildDocScript {
    fn new(state: Arc<WildDocState>) -> Result<Self>
    where
        Self: Sized;
    async fn evaluate_module(&self, file_name: &str, src: &[u8]) -> Result<()>;
    async fn eval(&self, code: &[u8]) -> Result<WildDocValue>;
}