1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use std::{borrow::Cow, sync::Arc};
use crate::{environment::Environment, schema::Schemas};
use async_trait::async_trait;
use serde_json::Value;
use taplo::dom::Keys;
use url::Url;
#[async_trait(?Send)]
pub trait Plugin<E: Environment>: 'static {
fn name(&self) -> Cow<'static, str>;
fn settings(&self, value: Value);
async fn possible_schemas(
&self,
schemas: &Schemas<E>,
root_schema_url: &Url,
schema: &Value,
root_path: &Keys,
relative_path: &Keys,
all_schemas: &mut Vec<(Keys, Keys, Arc<Value>)>,
) -> CollectSchemasAction;
}
pub enum CollectSchemasAction {
Continue,
Stop,
}