pub struct CovSubscriptionTable { /* private fields */ }Expand description
Table of active COV subscriptions.
Implementations§
Source§impl CovSubscriptionTable
impl CovSubscriptionTable
pub fn new() -> Self
Sourcepub fn subscribe(&mut self, sub: CovSubscription)
pub fn subscribe(&mut self, sub: CovSubscription)
Add or update a subscription.
Sourcepub fn unsubscribe(
&mut self,
mac: &[u8],
process_id: u32,
monitored_object: ObjectIdentifier,
) -> bool
pub fn unsubscribe( &mut self, mac: &[u8], process_id: u32, monitored_object: ObjectIdentifier, ) -> bool
Remove a subscription by subscriber MAC, process identifier, and monitored object.
Sourcepub fn subscriptions_for(
&mut self,
oid: &ObjectIdentifier,
) -> Vec<&CovSubscription>
pub fn subscriptions_for( &mut self, oid: &ObjectIdentifier, ) -> Vec<&CovSubscription>
Get all active (non-expired) subscriptions for a given object.
Sourcepub fn set_last_notified_value(
&mut self,
mac: &[u8],
process_id: u32,
monitored_object: ObjectIdentifier,
value: f32,
)
pub fn set_last_notified_value( &mut self, mac: &[u8], process_id: u32, monitored_object: ObjectIdentifier, value: f32, )
Update the last-notified value for a subscription.
Sourcepub fn should_notify(
sub: &CovSubscription,
current_value: Option<f32>,
cov_increment: Option<f32>,
) -> bool
pub fn should_notify( sub: &CovSubscription, current_value: Option<f32>, cov_increment: Option<f32>, ) -> bool
Check if a COV notification should fire for a subscription given the current present_value and the object’s COV_Increment.
Returns true if:
- No COV_Increment (binary/multi-state objects — always notify)
- No previous notified value (first notification)
|current - last_notified| >= cov_increment
Sourcepub fn purge_expired(&mut self) -> usize
pub fn purge_expired(&mut self) -> usize
Remove all expired subscriptions. Returns the number removed.
Trait Implementations§
Source§impl Debug for CovSubscriptionTable
impl Debug for CovSubscriptionTable
Source§impl Default for CovSubscriptionTable
impl Default for CovSubscriptionTable
Source§fn default() -> CovSubscriptionTable
fn default() -> CovSubscriptionTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CovSubscriptionTable
impl RefUnwindSafe for CovSubscriptionTable
impl Send for CovSubscriptionTable
impl Sync for CovSubscriptionTable
impl Unpin for CovSubscriptionTable
impl UnsafeUnpin for CovSubscriptionTable
impl UnwindSafe for CovSubscriptionTable
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