pub struct BeaconObserver { /* private fields */ }Expand description
Observes and tracks nearby geographic beacons
BeaconObserver subscribes to beacon updates from the storage backend and maintains a cache of nearby beacons based on geohash proximity.
Implementations§
Source§impl BeaconObserver
impl BeaconObserver
Sourcepub fn new(storage: Arc<dyn BeaconStorage>, my_geohash: String) -> Self
pub fn new(storage: Arc<dyn BeaconStorage>, my_geohash: String) -> Self
Create a new beacon observer
§Arguments
storage- Storage backend for beacon queries and subscriptionsmy_geohash- This node’s geohash for proximity filtering
Sourcepub async fn start(&self)
pub async fn start(&self)
Start observing beacons
Subscribes to beacon change events from storage and maintains a cache of nearby beacons based on geohash proximity.
Sourcepub async fn get_nearby_beacons(&self) -> Vec<GeographicBeacon>
pub async fn get_nearby_beacons(&self) -> Vec<GeographicBeacon>
Get all nearby beacons
Auto Trait Implementations§
impl Freeze for BeaconObserver
impl !RefUnwindSafe for BeaconObserver
impl Send for BeaconObserver
impl Sync for BeaconObserver
impl Unpin for BeaconObserver
impl UnsafeUnpin for BeaconObserver
impl !UnwindSafe for BeaconObserver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more