pub struct SequencedDataChanges { /* private fields */ }Expand description
One dedicated, pinned session for changes from 1–32 ordered variables. This owner explicitly manages Publish and Republish. Each arrival includes its original message sequence, source index, DataValue, clocks and retransmission provenance.
use opcua_kit::{Sample, SequencedDataChanges};
use std::time::Duration;
async fn poll(stream: &mut SequencedDataChanges) -> Result<(), Box<dyn std::error::Error>> {
let update = stream.next(Duration::from_secs(2)).await?;
let node = &stream.items()[update.value.index].node;
let sample = Sample::<u64>::from_raw(&update.value.value)?;
println!("{} sequence={} value={:?}", node.identifier(), update.sequence, sample.value);
Ok(())
}Implementations§
Source§impl SequencedDataChanges
impl SequencedDataChanges
Sourcepub async fn connect(
config: ConnectionConfig<'_>,
options: ConnectionOptions<'_>,
nodes: &[NodeId],
interval: Duration,
) -> Result<Self, PublishError>
pub async fn connect( config: ConnectionConfig<'_>, options: ConnectionOptions<'_>, nodes: &[NodeId], interval: Duration, ) -> Result<Self, PublishError>
Open a stream with one server monitored item per supplied stable node.
Sourcepub async fn connect_with_rollover(
config: ConnectionConfig<'_>,
options: ConnectionOptions<'_>,
rollover: CertificateRollover<'_>,
nodes: &[NodeId],
interval: Duration,
) -> Result<Self, PublishError>
pub async fn connect_with_rollover( config: ConnectionConfig<'_>, options: ConnectionOptions<'_>, rollover: CertificateRollover<'_>, nodes: &[NodeId], interval: Duration, ) -> Result<Self, PublishError>
Apply the same reviewed successor certificate policy as the ordinary client.
Sourcepub fn items(&self) -> &[MonitoredNode]
pub fn items(&self) -> &[MonitoredNode]
Original stable node identities and peer-revised settings, in request order.
Sourcepub async fn next(
&mut self,
wait: Duration,
) -> Result<Sequenced<DataChange>, PublishError>
pub async fn next( &mut self, wait: Duration, ) -> Result<Sequenced<DataChange>, PublishError>
Receive an indexed change. A cancelled or expired wait preserves in-flight recovery.
Sourcepub async fn disconnect(self)
pub async fn disconnect(self)
Complete shutdown of this dedicated session.
Auto Trait Implementations§
impl !RefUnwindSafe for SequencedDataChanges
impl !UnwindSafe for SequencedDataChanges
impl Forget for SequencedDataChanges
impl Freeze for SequencedDataChanges
impl Move for SequencedDataChanges
impl Send for SequencedDataChanges
impl Sync for SequencedDataChanges
impl Unpin for SequencedDataChanges
impl UnsafeUnpin for SequencedDataChanges
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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