bb_ops/syscalls/triggers/
pulse.rs1use bb_ir::proto::onnx::NodeProto;
4use bb_runtime::atomic::DispatchResult;
5use bb_runtime::bus::OpError;
6use bb_runtime::runtime::RuntimeResourceRef;
7use bb_runtime::slot_value::SlotValue;
8use bb_runtime::syscall::values::TriggerValue;
9
10pub struct PulseOp;
12
13pub const DOMAIN: &str = "ai.bytesandbrains.syscall";
15pub const OP_TYPE: &str = "Pulse";
17
18pub fn invoke(
20 _node: &NodeProto,
21 _inputs: &[(&str, &dyn SlotValue)],
22 _ctx: &mut RuntimeResourceRef<'_>,
23) -> Result<DispatchResult, OpError> {
24 Ok(DispatchResult::Immediate(vec![(
25 "trigger".to_string(),
26 Box::new(TriggerValue),
27 )]))
28}
29
30use bb_runtime::registry::OpRegistration as _BbOpsSyscallReg;
31
32inventory::submit! {
33 _BbOpsSyscallReg {
34 domain: DOMAIN,
35 op_type: OP_TYPE,
36 invoke,
37 kind: bb_runtime::registry::RegistrationKind::Syscall,
38 }
39}