reifydb_sub_flow/operator/
apply.rs1use reifydb_abi::operator::capabilities::OperatorCapability;
5use reifydb_core::{
6 interface::{catalog::flow::FlowNodeId, change::Change},
7 value::column::columns::Columns,
8};
9use reifydb_sdk::operator::Tick;
10use reifydb_value::{Result, value::duration::Duration};
11
12use crate::{
13 operator::{BoxedOperator, Operator, OperatorCell},
14 transaction::FlowTransaction,
15};
16
17pub struct ApplyOperator {
18 parent: OperatorCell,
19 node: FlowNodeId,
20 inner: BoxedOperator,
21}
22
23impl ApplyOperator {
24 pub fn new(parent: OperatorCell, node: FlowNodeId, inner: BoxedOperator) -> Self {
25 Self {
26 parent,
27 node,
28 inner,
29 }
30 }
31}
32
33impl ApplyOperator {
34 pub(crate) fn output_schema(&self) -> Option<Columns> {
35 self.parent.output_schema()
36 }
37}
38
39impl Operator for ApplyOperator {
40 fn id(&self) -> FlowNodeId {
41 self.node
42 }
43
44 fn capabilities(&self) -> &[OperatorCapability] {
45 self.inner.capabilities()
46 }
47
48 fn ticks(&self) -> Option<Duration> {
49 self.inner.ticks()
50 }
51
52 fn apply(&self, txn: &mut FlowTransaction, change: Change) -> Result<Change> {
53 self.inner.apply(txn, change)
54 }
55
56 fn tick(&self, txn: &mut FlowTransaction, tick: Tick) -> Result<Option<Change>> {
57 self.inner.tick(txn, tick)
58 }
59}