HiveObserver

Trait HiveObserver 

Source
pub trait HiveObserver: Send + Sync {
    // Required method
    fn on_event(&self, event: HiveEvent);
}
Expand description

Observer trait for receiving HIVE mesh events

Implement this trait to receive callbacks when mesh events occur. Observers must be thread-safe (Send + Sync) as they may be called from any thread.

§Platform Notes

  • iOS/macOS: Wrap in a Swift class that conforms to this protocol via UniFFI
  • Android: Implement via JNI callback interface
  • ESP32: Use direct Rust implementation with static callbacks

Required Methods§

Source

fn on_event(&self, event: HiveEvent)

Called when a mesh event occurs

This method should return quickly to avoid blocking the mesh. If heavy processing is needed, dispatch to another thread.

Implementors§

Source§

impl HiveObserver for CollectingObserver

Available on crate feature std only.