pub struct DataValue {
    pub value: Option<Variant>,
    pub status: Option<StatusCode>,
    pub source_timestamp: Option<DateTime>,
    pub source_picoseconds: Option<i16>,
    pub server_timestamp: Option<DateTime>,
    pub server_picoseconds: Option<i16>,
}
Expand description

A data value is a value of a variable in the OPC UA server and contains information about its value, status and change timestamps.

Fields

value: Option<Variant>

The value. BaseDataType Not present if the Value bit in the EncodingMask is False.

status: Option<StatusCode>

The status associated with the value. Not present if the StatusCode bit in the EncodingMask is False

source_timestamp: Option<DateTime>

The source timestamp associated with the value. Not present if the SourceTimestamp bit in the EncodingMask is False.

source_picoseconds: Option<i16>

The number of 10 picosecond intervals for the SourceTimestamp. Not present if the SourcePicoSeconds bit in the EncodingMask is False. If the source timestamp is missing the picoseconds are ignored.

server_timestamp: Option<DateTime>

The Server timestamp associated with the value. Not present if the ServerTimestamp bit in the EncodingMask is False.

server_picoseconds: Option<i16>

The number of 10 picosecond intervals for the ServerTimestamp. Not present if the ServerPicoSeconds bit in the EncodingMask is False. If the Server timestamp is missing the picoseconds are ignored.

Implementations

Creates a DataValue from the supplied value with nothing else.

Creates a DataValue from the supplied value AND a timestamp for now. If you are passing a value to the Attribute::Write service on a server from a server, you may consider this from the specification:

If the SourceTimestamp or the ServerTimestamp is specified, the Server shall use these values. The Server returns a Bad_WriteNotSupported error if it does not support writing of timestamps

In which case, use the value_only() constructor, or make explicit which fields you pass.

Creates an empty DataValue

Sets the value of the data value, updating the timestamps at the same point

Sets the timestamps of the data value based on supplied timestamps to return

Returns the status code or Good if there is no code on the value

Test if the value held by this data value is known to be good Anything other than Good is assumed to be invalid.

Trait Implementations

Returns the exact byte length of the structure as it would be if encode were called. This may be called prior to writing to ensure the correct amount of space is available. Read more

Encodes the instance to the write stream.

Decodes an instance from the read stream. The decoding options contains restrictions set by the server / client on the length of strings, arrays etc. If these limits are exceeded the implementation should return with a BadDecodingError as soon as possible. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.