vector_config/component/generate.rs
1/// A component that can generate a default configuration for itself.
2pub trait GenerateConfig {
3 fn generate_config() -> serde_json::Value;
4}
5
6#[macro_export]
7macro_rules! impl_generate_config_from_default {
8 ($type:ty) => {
9 impl $crate::component::GenerateConfig for $type {
10 fn generate_config() -> serde_json::Value {
11 serde_json::to_value(&Self::default()).unwrap()
12 }
13 }
14 };
15}