wick_config/config/
components.rs1mod grpcurl;
2mod http_client;
3mod manifest;
4mod native;
5mod reference;
6mod sql;
7mod types;
8mod wasm;
9
10use std::borrow::Cow;
11
12pub use grpcurl::*;
13pub use http_client::*;
14pub use manifest::*;
15pub use native::*;
16pub use reference::*;
17pub use sql::*;
18pub use types::*;
19pub use wasm::*;
20use wick_interface_types::{Field, OperationSignatures};
21
22pub trait OperationConfig {
23 fn name(&self) -> &str;
25
26 fn inputs(&self) -> Cow<Vec<Field>>;
28
29 fn outputs(&self) -> Cow<Vec<Field>>;
31}
32
33pub trait ComponentConfig: OperationSignatures {
34 type Operation: OperationConfig;
35
36 fn operations(&self) -> &[Self::Operation];
38
39 fn operations_mut(&mut self) -> &mut Vec<Self::Operation>;
41
42 fn get_operation(&self, name: &str) -> Option<&Self::Operation> {
44 self.operations().iter().find(|o| o.name() == name)
45 }
46}