pub struct JsonDeserializerBuilder { /* private fields */ }Expand description
Builder produced from the opaque config section; hands out either the typed or the dynamically-typed deserializer.
Implementations§
Source§impl JsonDeserializerBuilder
impl JsonDeserializerBuilder
Sourcepub fn from_component(cfg: &ComponentConfig) -> Result<Self, JsonConfigError>
pub fn from_component(cfg: &ComponentConfig) -> Result<Self, JsonConfigError>
Build from the pipeline’s deserializer component section.
Sourcepub fn from_settings(settings: JsonSettings) -> Self
pub fn from_settings(settings: JsonSettings) -> Self
Build from already-parsed settings.
Sourcepub fn for_source_framing(
self,
contract: FramingContract,
) -> Result<Self, JsonConfigError>
pub fn for_source_framing( self, contract: FramingContract, ) -> Result<Self, JsonConfigError>
Derive and validate framing against the source’s
FramingContract, so the format
is declared once (on the source) instead of coordinating the source’s
framing with framing: by hand.
PerRecord: the source already frames one record per payload, so the deserializer must decode a single document.framing: single(the default) is used; any otherframingis aDoubleFramingerror.WholePayload: the deserializer owns framing — the configuredframing(single/ndjson/array) is honored unchanged.
Sourcepub fn with_metrics(
self,
pipeline: impl Into<SharedString>,
component: impl Into<SharedString>,
) -> Self
pub fn with_metrics( self, pipeline: impl Into<SharedString>, component: impl Into<SharedString>, ) -> Self
Scope the connector-owned spate_json_deser_* metrics to this component.
Reuse the pipeline / component values the framework was given so the
families join against the generic spate_deser_* stage metrics. Without
this, per-record skips are logged (rate-limited) but not counted.
Sourcepub fn build_serde<T>(&self) -> JsonSerdeDeserializer<T>where
T: DeserializeOwned + Send + 'static,
pub fn build_serde<T>(&self) -> JsonSerdeDeserializer<T>where
T: DeserializeOwned + Send + 'static,
Decode each document into your own T: serde::de::DeserializeOwned.
Sourcepub fn build_value(&self) -> JsonValueDeserializer
pub fn build_value(&self) -> JsonValueDeserializer
Decode each document into a dynamically-typed serde_json::Value.
Trait Implementations§
Source§impl Clone for JsonDeserializerBuilder
impl Clone for JsonDeserializerBuilder
Source§fn clone(&self) -> JsonDeserializerBuilder
fn clone(&self) -> JsonDeserializerBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more