pub struct StreamBuilder { /* private fields */ }Expand description
Fluent builder for a Pulse streaming pipeline.
Chain operator methods, then call build (or pass to
StreamsResource::deploy).
All operator methods take &mut self and return Self so calls chain
naturally. Methods that validate their inputs panic on obviously-bad
arguments (blank required fields, non-positive counts, unknown enum
values) so bugs are caught at call site, not after a 400 round-trip.
Implementations§
Source§impl StreamBuilder
impl StreamBuilder
Sourcepub fn anonymous() -> Self
pub fn anonymous() -> Self
Builder with no preset name. Use named or pass the
name to build_with_name.
Sourcepub fn from_topic(self, topic: impl Into<String>) -> Self
pub fn from_topic(self, topic: impl Into<String>) -> Self
Sets the input topic. Source engine defaults to "kafka".
Sourcepub fn from_topic_with_engine(
self,
topic: impl Into<String>,
engine: impl Into<String>,
) -> Self
pub fn from_topic_with_engine( self, topic: impl Into<String>, engine: impl Into<String>, ) -> Self
Sets the input topic + source engine.
Sourcepub fn with_source_config(self, key: impl Into<String>, value: Value) -> Self
pub fn with_source_config(self, key: impl Into<String>, value: Value) -> Self
Merges extra config into the source node’s config map.
Sourcepub fn with_source_label(self, label: impl Into<String>) -> Self
pub fn with_source_label(self, label: impl Into<String>) -> Self
Sets the display label for the source node.
Sourcepub fn filter(self, condition: impl Into<String>) -> Self
pub fn filter(self, condition: impl Into<String>) -> Self
Filter operator. condition is a CEL-like expression string.
Sourcepub fn map(self, options: MapOptions) -> Self
pub fn map(self, options: MapOptions) -> Self
Map operator. At least one of options.fields / options.target_type is required.
Sourcepub fn flat_map(self, split_field: impl Into<String>) -> Self
pub fn flat_map(self, split_field: impl Into<String>) -> Self
Flat-map: explode an array-valued field into one event per element.
Sourcepub fn key_by(self, field: impl Into<String>) -> Self
pub fn key_by(self, field: impl Into<String>) -> Self
Group the stream by a top-level field value. Required before stateful ops.
Sourcepub fn window(self, spec: WindowSpec) -> Self
pub fn window(self, spec: WindowSpec) -> Self
Window operator with no extra options.
Sourcepub fn window_with_aggs(
self,
spec: WindowSpec,
aggregations: BTreeMap<String, String>,
) -> Self
pub fn window_with_aggs( self, spec: WindowSpec, aggregations: BTreeMap<String, String>, ) -> Self
Window operator with aggregations only.
Sourcepub fn window_full(self, spec: WindowSpec, options: WindowOptions) -> Self
pub fn window_full(self, spec: WindowSpec, options: WindowOptions) -> Self
Window operator with the full option set.
Sourcepub fn window_from_str(self, spec: &str, options: WindowOptions) -> Self
pub fn window_from_str(self, spec: &str, options: WindowOptions) -> Self
Window operator with a raw spec string. Useful when you’ve already
validated the spec against WindowEngine.parseSpec.
Sourcepub fn branch(self, branches: Vec<BranchSpec>) -> Self
pub fn branch(self, branches: Vec<BranchSpec>) -> Self
Branch operator: route events to different topics by condition.
Sourcepub fn enrich(
self,
lookup_topic: impl Into<String>,
key_field: impl Into<String>,
) -> Self
pub fn enrich( self, lookup_topic: impl Into<String>, key_field: impl Into<String>, ) -> Self
Synchronous enrichment: join the stream against a state-store topic.
Sourcepub fn enrich_async(self, options: EnrichAsyncOptions) -> Self
pub fn enrich_async(self, options: EnrichAsyncOptions) -> Self
Asynchronous HTTP enrichment. url supports {field} placeholders.
Sourcepub fn cep(self, sequence: Vec<Value>, options: CepOptions) -> Self
pub fn cep(self, sequence: Vec<Value>, options: CepOptions) -> Self
Complex Event Processing: match a sequence of conditions.
Sourcepub fn broadcast_join(self, options: BroadcastJoinOptions) -> Self
pub fn broadcast_join(self, options: BroadcastJoinOptions) -> Self
Broadcast join: enrich the stream against a fully-replicated table.
Sourcepub fn cdc_join(self, options: CdcJoinOptions) -> Self
pub fn cdc_join(self, options: CdcJoinOptions) -> Self
CDC join: stream-table join against a CDC-fed state table.
Sourcepub fn to_topic(self, topic: impl Into<String>) -> Self
pub fn to_topic(self, topic: impl Into<String>) -> Self
Sets the output topic only. No sink node is emitted.
Sourcepub fn to_topic_with_channel(
self,
topic: impl Into<String>,
channel: impl Into<String>,
) -> Self
pub fn to_topic_with_channel( self, topic: impl Into<String>, channel: impl Into<String>, ) -> Self
Sets the output topic + sink channel (emits a sink node).
Sourcepub fn with_sink_config(self, key: impl Into<String>, value: Value) -> Self
pub fn with_sink_config(self, key: impl Into<String>, value: Value) -> Self
Merges extra config into the sink node’s config map.
Sourcepub fn with_sink_label(self, label: impl Into<String>) -> Self
pub fn with_sink_label(self, label: impl Into<String>) -> Self
Sets the display label for the sink node.
Sourcepub fn to_state(self) -> Self
pub fn to_state(self) -> Self
Terminate the stream in the agent’s state store (queryable via B-106 IQ).
Sourcepub fn described_as(self, description: impl Into<String>) -> Self
pub fn described_as(self, description: impl Into<String>) -> Self
Sets the pipeline description.
Sourcepub fn with_agent_label(self, label: impl Into<String>) -> Self
pub fn with_agent_label(self, label: impl Into<String>) -> Self
Sets the display label for the streaming agent node.
Sourcepub fn operators(&self) -> &[Map<String, Value>]
pub fn operators(&self) -> &[Map<String, Value>]
Returns a read-only view of the recorded operator chain.
Sourcepub fn build(&self) -> Result<Value, PulseError>
pub fn build(&self) -> Result<Value, PulseError>
Compile the chain into a Pulse pipeline dict ready for POST.
Sourcepub fn build_with_name(&self, name: &str) -> Result<Value, PulseError>
pub fn build_with_name(&self, name: &str) -> Result<Value, PulseError>
Same as build but overrides the pipeline name.
Trait Implementations§
Source§impl Clone for StreamBuilder
impl Clone for StreamBuilder
Source§fn clone(&self) -> StreamBuilder
fn clone(&self) -> StreamBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more