opcua_types/service_types/
history_data.rs

1// OPCUA for Rust
2// SPDX-License-Identifier: MPL-2.0
3// Copyright (C) 2017-2022 Adam Lock
4//
5// This file was autogenerated from Opc.Ua.Types.bsd by tools/schema/gen_types.js
6//
7// DO NOT EDIT THIS FILE
8#![allow(unused_attributes)]
9use std::io::{Read, Write};
10#[allow(unused_imports)]
11use crate::{
12    encoding::*,
13    basic_types::*,
14    service_types::impls::MessageInfo,
15    node_ids::ObjectId,
16    data_value::DataValue,
17};
18
19#[derive(Debug, Clone, PartialEq)]
20pub struct HistoryData {
21    pub data_values: Option<Vec<DataValue>>,
22}
23
24impl MessageInfo for HistoryData {
25    fn object_id(&self) -> ObjectId {
26        ObjectId::HistoryData_Encoding_DefaultBinary
27    }
28}
29
30impl BinaryEncoder<HistoryData> for HistoryData {
31    fn byte_len(&self) -> usize {
32        let mut size = 0;
33        size += byte_len_array(&self.data_values);
34        size
35    }
36
37    #[allow(unused_variables)]
38    fn encode<S: Write>(&self, stream: &mut S) -> EncodingResult<usize> {
39        let mut size = 0;
40        size += write_array(stream, &self.data_values)?;
41        Ok(size)
42    }
43
44    #[allow(unused_variables)]
45    fn decode<S: Read>(stream: &mut S, decoding_options: &DecodingOptions) -> EncodingResult<Self> {
46        let data_values: Option<Vec<DataValue>> = read_array(stream, decoding_options)?;
47        Ok(HistoryData {
48            data_values,
49        })
50    }
51}