opcua_types/service_types/
delete_subscriptions_response.rs1#![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 response_header::ResponseHeader,
17 status_codes::StatusCode,
18 diagnostic_info::DiagnosticInfo,
19};
20
21#[derive(Debug, Clone, PartialEq)]
22pub struct DeleteSubscriptionsResponse {
23 pub response_header: ResponseHeader,
24 pub results: Option<Vec<StatusCode>>,
25 pub diagnostic_infos: Option<Vec<DiagnosticInfo>>,
26}
27
28impl MessageInfo for DeleteSubscriptionsResponse {
29 fn object_id(&self) -> ObjectId {
30 ObjectId::DeleteSubscriptionsResponse_Encoding_DefaultBinary
31 }
32}
33
34impl BinaryEncoder<DeleteSubscriptionsResponse> for DeleteSubscriptionsResponse {
35 fn byte_len(&self) -> usize {
36 let mut size = 0;
37 size += self.response_header.byte_len();
38 size += byte_len_array(&self.results);
39 size += byte_len_array(&self.diagnostic_infos);
40 size
41 }
42
43 #[allow(unused_variables)]
44 fn encode<S: Write>(&self, stream: &mut S) -> EncodingResult<usize> {
45 let mut size = 0;
46 size += self.response_header.encode(stream)?;
47 size += write_array(stream, &self.results)?;
48 size += write_array(stream, &self.diagnostic_infos)?;
49 Ok(size)
50 }
51
52 #[allow(unused_variables)]
53 fn decode<S: Read>(stream: &mut S, decoding_options: &DecodingOptions) -> EncodingResult<Self> {
54 let response_header = ResponseHeader::decode(stream, decoding_options)?;
55 let results: Option<Vec<StatusCode>> = read_array(stream, decoding_options)?;
56 let diagnostic_infos: Option<Vec<DiagnosticInfo>> = read_array(stream, decoding_options)?;
57 Ok(DeleteSubscriptionsResponse {
58 response_header,
59 results,
60 diagnostic_infos,
61 })
62 }
63}