Struct opcua_types::data_value::DataValue [−][src]
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.
Sets the value of the data value, updating the timestamps at the same point
pub fn set_timestamps(
&mut self,
timestamps_to_return: TimestampsToReturn,
source_timestamp: DateTime,
server_timestamp: DateTime
)
pub fn set_timestamps(
&mut self,
timestamps_to_return: TimestampsToReturn,
source_timestamp: DateTime,
server_timestamp: DateTime
)
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
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 limits are 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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for DataValue
impl UnwindSafe for DataValue
Blanket Implementations
Mutably borrows from an owned value. Read more