pub trait ComponentBundle: Sized {
// Required methods
fn config_key() -> &'static str;
fn from_toml(value: Value) -> Result<Self, CamelError>;
fn register_all(self, ctx: &mut dyn ComponentRegistrar);
}Expand description
A bundle groups one or more related component schemes and their shared config.
Bundles own their TOML key and deserialize their own config block.
camel-cli uses register_bundle! to wire them.
Required Methods§
Sourcefn config_key() -> &'static str
fn config_key() -> &'static str
Key under [components.
Sourcefn from_toml(value: Value) -> Result<Self, CamelError>
fn from_toml(value: Value) -> Result<Self, CamelError>
Deserialize the raw toml::Value block for this bundle.
Sourcefn register_all(self, ctx: &mut dyn ComponentRegistrar)
fn register_all(self, ctx: &mut dyn ComponentRegistrar)
Register all schemes this bundle owns into the context.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.