Skip to main content

reifydb_sub_flow/operator/scan/
dictionary.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3
4use reifydb_abi::operator::capabilities::OperatorCapability;
5use reifydb_core::interface::{catalog::flow::FlowNodeId, change::Change};
6use reifydb_value::Result;
7
8use crate::{Operator, transaction::FlowTransaction};
9
10pub struct PrimitiveDictionaryOperator {
11	node: FlowNodeId,
12}
13
14impl PrimitiveDictionaryOperator {
15	pub fn new(node: FlowNodeId) -> Self {
16		Self {
17			node,
18		}
19	}
20}
21
22impl Operator for PrimitiveDictionaryOperator {
23	fn id(&self) -> FlowNodeId {
24		self.node
25	}
26
27	fn capabilities(&self) -> &[OperatorCapability] {
28		OperatorCapability::STANDARD
29	}
30
31	fn apply(&self, _txn: &mut FlowTransaction, change: Change) -> Result<Change> {
32		Ok(Change::from_flow(self.node, change.version, change.diffs, change.changed_at))
33	}
34}