pub struct Subscription {
    pub subscription_id: u32,
    pub publishing_interval: Duration,
    pub max_lifetime_count: u32,
    pub max_keep_alive_count: u32,
    pub priority: u8,
    pub monitored_items: HashMap<u32, MonitoredItem>,
    pub state: SubscriptionState,
    pub current_lifetime_count: u32,
    pub current_keep_alive_count: u32,
    pub message_sent: bool,
    pub publishing_enabled: bool,
    pub diagnostics_on_drop: bool,
    /* private fields */
}

Fields§

§subscription_id: u32

Subscription id

§publishing_interval: Duration

Publishing interval in milliseconds

§max_lifetime_count: u32

The lifetime count reset value

§max_keep_alive_count: u32

Keep alive count reset value

§priority: u8

Relative priority of the subscription. When more than one subscriptio needs to send notifications the highest priority subscription should be sent first.

§monitored_items: HashMap<u32, MonitoredItem>

Map of monitored items

§state: SubscriptionState

State of the subscription

§current_lifetime_count: u32

A value that contains the number of consecutive publishing timer expirations without Client activity before the Subscription is terminated.

§current_keep_alive_count: u32

Keep alive counter decrements when there are no notifications to publish and when it expires requests to send an empty notification as a keep alive event

§message_sent: bool

boolean value that is set to true to mean that either a NotificationMessage or a keep-alive Message has been sent on the Subscription. It is a flag that is used to ensure that either a NotificationMessage or a keep-alive Message is sent out the first time the publishing timer expires.

§publishing_enabled: bool

The parameter that requests publishing to be enabled or disabled.

§diagnostics_on_drop: bool

Stops the subscription calling diagnostics on drop

Implementations§

Creates monitored items on the specified subscription, returning the creation results

Modify the specified monitored items, returning a result for each

Delete the specified monitored items (by item id), returning a status code for each

Sets the resend data flag which means the next publish request will receive the latest value of every monitored item whether it has changed in this cycle or not.

Checks the subscription and monitored items for state change, messages. If the tick does nothing, the function returns None. Otherwise it returns one or more messages in an Vec.

Reset the keep-alive counter to the maximum keep-alive count of the Subscription. The maximum keep-alive count is set by the Client when the Subscription is created and may be modified using the ModifySubscription Service

Reset the lifetime counter to the value specified for the life time of the subscription in the create subscription service

Start or restart the publishing timer and decrement the LifetimeCounter Variable.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.