pub struct SubscriptionCallbacks { /* private fields */ }
Expand description
A convenient wrapper around a set of callback functions that implements OnSubscriptionNotification
Implementations§
Source§impl SubscriptionCallbacks
impl SubscriptionCallbacks
Sourcepub fn new(
status_change: impl FnMut(StatusChangeNotification) + Send + Sync + 'static,
data_value: impl FnMut(DataValue, &MonitoredItem) + Send + Sync + 'static,
event: impl FnMut(Option<Vec<Variant>>, &MonitoredItem) + Send + Sync + 'static,
) -> Self
pub fn new( status_change: impl FnMut(StatusChangeNotification) + Send + Sync + 'static, data_value: impl FnMut(DataValue, &MonitoredItem) + Send + Sync + 'static, event: impl FnMut(Option<Vec<Variant>>, &MonitoredItem) + Send + Sync + 'static, ) -> Self
Create a new subscription callback wrapper.
§Arguments
status_change
- Called when a subscription changes state on the server.data_value
- Called for each received data value.event
- Called for each received event.
Trait Implementations§
Source§impl OnSubscriptionNotification for SubscriptionCallbacks
impl OnSubscriptionNotification for SubscriptionCallbacks
Source§fn on_subscription_status_change(
&mut self,
notification: StatusChangeNotification,
)
fn on_subscription_status_change( &mut self, notification: StatusChangeNotification, )
Called when a subscription changes state on the server.
Source§fn on_data_value(&mut self, notification: DataValue, item: &MonitoredItem)
fn on_data_value(&mut self, notification: DataValue, item: &MonitoredItem)
Called for each data value change.
Auto Trait Implementations§
impl Freeze for SubscriptionCallbacks
impl !RefUnwindSafe for SubscriptionCallbacks
impl Send for SubscriptionCallbacks
impl Sync for SubscriptionCallbacks
impl Unpin for SubscriptionCallbacks
impl !UnwindSafe for SubscriptionCallbacks
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> OnSubscriptionNotificationCore for T
impl<T> OnSubscriptionNotificationCore for T
Source§fn on_subscription_notification(
&mut self,
notification: NotificationMessage,
monitored_items: MonitoredItemMap<'_>,
)
fn on_subscription_notification( &mut self, notification: NotificationMessage, monitored_items: MonitoredItemMap<'_>, )
Called when a notification is received on a subscription.