Skip to main content

set_event_observer

Function set_event_observer 

Source
pub fn set_event_observer(observer: Option<Box<EventObserver>>)
Expand description

Install (or clear, with None) an observer that sees every event day-core dispatches, in queue order, at the one point EVERY backend funnels native events through (enqueue_events, §8.3) — BEFORE the event reaches the app, so it observes exactly what the app receives. This is the recording/telemetry seam behind day::record (§14.6): a higher layer captures user actions into a replayable dayscript without touching any of the backends. Main-thread only; a None observer adds no cost to the event path. The boxed closure is adopted into an Rc internally so enqueue_events can call it with no borrow held.

Day API ↩ Guides· daybrite.dev