#include "operator.h" #include #include #include "../build/dora-operator-api.h" Operator::Operator() {} std::unique_ptr new_operator() { return std::make_unique(); } DoraOnInputResult on_input(Operator &op, rust::Str id, rust::Slice data, OutputSender &output_sender) { op.counter += 1; std::cout << "Rust API operator received input `" << id.data() << "` with data `" << (unsigned int)data[0] << "` (internal counter: " << (unsigned int)op.counter << ")" << std::endl; std::vector out_vec{op.counter}; rust::Slice out_slice{out_vec.data(), out_vec.size()}; auto send_result = send_output(output_sender, rust::Str("status"), out_slice); DoraOnInputResult result = {send_result.error, false}; return result; }