pub struct DataStore { /* private fields */ }Expand description
Central reactive store for all UniFi domain entities.
Thread-safe and lock-free: all reads are wait-free, writes use
fine-grained per-shard locks within DashMap. Mutations are
broadcast to subscribers via watch channels.
Implementations§
Source§impl DataStore
impl DataStore
pub fn new() -> Self
pub fn devices_snapshot(&self) -> Arc<Vec<Arc<Device>>>
pub fn clients_snapshot(&self) -> Arc<Vec<Arc<Client>>>
pub fn networks_snapshot(&self) -> Arc<Vec<Arc<Network>>>
pub fn wifi_broadcasts_snapshot(&self) -> Arc<Vec<Arc<WifiBroadcast>>>
pub fn firewall_policies_snapshot(&self) -> Arc<Vec<Arc<FirewallPolicy>>>
pub fn firewall_zones_snapshot(&self) -> Arc<Vec<Arc<FirewallZone>>>
pub fn acl_rules_snapshot(&self) -> Arc<Vec<Arc<AclRule>>>
pub fn dns_policies_snapshot(&self) -> Arc<Vec<Arc<DnsPolicy>>>
pub fn vouchers_snapshot(&self) -> Arc<Vec<Arc<Voucher>>>
pub fn sites_snapshot(&self) -> Arc<Vec<Arc<Site>>>
pub fn events_snapshot(&self) -> Arc<Vec<Arc<Event>>>
pub fn traffic_matching_lists_snapshot( &self, ) -> Arc<Vec<Arc<TrafficMatchingList>>>
pub fn device_by_mac(&self, mac: &MacAddress) -> Option<Arc<Device>>
pub fn device_by_id(&self, id: &EntityId) -> Option<Arc<Device>>
pub fn client_by_mac(&self, mac: &MacAddress) -> Option<Arc<Client>>
pub fn client_by_id(&self, id: &EntityId) -> Option<Arc<Client>>
pub fn network_by_id(&self, id: &EntityId) -> Option<Arc<Network>>
pub fn device_count(&self) -> usize
pub fn client_count(&self) -> usize
pub fn network_count(&self) -> usize
pub fn subscribe_devices(&self) -> EntityStream<Device>
pub fn subscribe_clients(&self) -> EntityStream<Client>
pub fn subscribe_networks(&self) -> EntityStream<Network>
pub fn subscribe_wifi_broadcasts(&self) -> EntityStream<WifiBroadcast>
pub fn subscribe_firewall_policies(&self) -> EntityStream<FirewallPolicy>
pub fn subscribe_firewall_zones(&self) -> EntityStream<FirewallZone>
pub fn subscribe_acl_rules(&self) -> EntityStream<AclRule>
pub fn subscribe_dns_policies(&self) -> EntityStream<DnsPolicy>
pub fn subscribe_vouchers(&self) -> EntityStream<Voucher>
pub fn subscribe_sites(&self) -> EntityStream<Site>
pub fn subscribe_events(&self) -> EntityStream<Event>
pub fn subscribe_traffic_matching_lists( &self, ) -> EntityStream<TrafficMatchingList>
pub fn site_health_snapshot(&self) -> Arc<Vec<HealthSummary>>
pub fn subscribe_site_health(&self) -> Receiver<Arc<Vec<HealthSummary>>>
pub fn last_full_refresh(&self) -> Option<DateTime<Utc>>
pub fn last_ws_event(&self) -> Option<DateTime<Utc>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataStore
impl !RefUnwindSafe for DataStore
impl Send for DataStore
impl Sync for DataStore
impl Unpin for DataStore
impl UnsafeUnpin for DataStore
impl UnwindSafe for DataStore
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