pub struct ComponentConfig { /* private fields */ }Expand description
An opaque component section: { <type_tag>: { ...connector config... } }.
The framework records which component type the section selects (kafka,
clickhouse, memory, …) and hands the body to that component’s
factory, which deserializes it into its own typed config via
deserialize_into. One key is the exception to
that opacity: chunk is framework-reserved — it configures the chain
terminal, not the connector, and is peeled out of the body at construction.
A connector must not declare its own chunk field: it would never receive
a value (on a sink section the framework consumes the key; on a
source/deserializer section the key is rejected outright).
The nested-block shape (exactly one key) is what lets every typed struct
in the tree keep deny_unknown_fields — a flattened shape would disable
that check.
Implementations§
Source§impl ComponentConfig
impl ComponentConfig
Sourcepub fn deserialize_into<T: DeserializeOwned>(&self) -> Result<T, ConfigError>
pub fn deserialize_into<T: DeserializeOwned>(&self) -> Result<T, ConfigError>
Deserialize the opaque body into the component’s typed config.
Errors carry the full dotted path from the pipeline config root,
e.g. source.kafka.brokers: missing field \brokers``.
Sourcepub fn new(type_tag: impl Into<String>, raw: YamlValue) -> Self
pub fn new(type_tag: impl Into<String>, raw: YamlValue) -> Self
Build a component config programmatically (primarily for tests and
spate-test pipelines that skip YAML).
raw is the opaque connector body as a YamlValue
(an spate-core re-export of serde_yaml::Value — see its docs for the
dependency-policy exemption). The framework-reserved chunk key is
peeled out of raw here, exactly as on the YAML path — see the struct
docs.
Trait Implementations§
Source§impl Clone for ComponentConfig
impl Clone for ComponentConfig
Source§fn clone(&self) -> ComponentConfig
fn clone(&self) -> ComponentConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more