Skip to main content

SequencedDataChanges

Struct SequencedDataChanges 

Source
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

Source

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.

Source

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.

Source

pub fn items(&self) -> &[MonitoredNode]

Original stable node identities and peer-revised settings, in request order.

Source

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.

Source

pub async fn disconnect(self)

Complete shutdown of this dedicated session.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.