Skip to main content

arm_reporter

Function arm_reporter 

Source
pub unsafe fn arm_reporter(
    executor: &mut Executor<'_>,
    domain_id: u32,
    slot: &mut Option<DiagSink>,
) -> bool
Expand description

Arm one executor’s /diagnostics reporter in slot, and point the executor’s violation sink at it — THE arming step, shared by install_contract_monitors (Rust) and nros-cpp’s nros_cpp_install_monitors (C and C++), issue 1693.

  • Idempotent: a slot already holding a reporter keeps it.
  • A CENSUS run arms nothing ([crate::census_hooks::recording_run]): it never spins, so the reporter could never publish, and the recorder has no node open yet to attribute it to — it refused the publisher, and the C/C++ road turned that refusal into a failed setup that recorded nothing.
  • A publisher that cannot be created is REPORTED, never fatal: the tables stay installed and every violation still reaches the log (issue 0514’s floor). Both roads say so in the one message below; before this the C/C++ road logged “violations stay in the log only” and then failed the setup.

Returns whether a reporter is armed after the call.

§Safety

slot must not move, and must outlive every spin of executor, until the sink is removed (set_violation_sink(None)) or the executor is dropped — DiagSink::hook’s contract.