1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#[cfg(feature = "http")]
extern crate actix_web;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate derivative;
#[macro_use]
extern crate opcua_core;
macro_rules! is_empty_option_vec {
( $v: expr ) => {
$v.is_none() || $v.as_ref().unwrap().is_empty()
};
}
mod identity_token;
mod services;
#[cfg(feature = "discovery-server-registration")]
mod discovery;
mod session_diagnostics;
#[cfg(feature = "http")]
pub mod http;
pub mod address_space;
pub mod builder;
pub mod callbacks;
pub mod comms;
pub mod config;
pub mod continuation_point;
pub mod diagnostics;
#[macro_use]
pub mod events;
pub mod historical;
pub mod metrics;
pub mod server;
pub mod session;
pub mod state;
pub mod subscriptions;
pub mod util;
pub mod prelude {
pub use crate::{
address_space::types::*,
address_space::{AccessLevel, EventNotifier, UserAccessLevel},
builder::*,
callbacks::*,
config::*,
events::event::*,
historical::*,
server::*,
subscriptions::*,
util::*,
};
pub use opcua_core::prelude::*;
pub use opcua_crypto::*;
pub use opcua_types::service_types::*;
pub use opcua_types::status_code::StatusCode;
pub use opcua_types::*;
}
pub mod constants {
pub const DEFAULT_HELLO_TIMEOUT_SECONDS: u32 = 5;
pub const DEFAULT_RUST_OPC_UA_SERVER_PORT: u16 = 4855;
pub const DEFAULT_MAX_SUBSCRIPTIONS: u32 = 100;
pub const DEFAULT_MAX_MONITORED_ITEMS_PER_SUB: u32 = 1000;
pub const DEFAULT_DISCOVERY_SERVER_URL: &str = "opc.tcp://localhost:4840/UADiscovery";
pub const SUBSCRIPTION_TIMER_RATE_MS: u64 = 100;
pub const MIN_PUBLISHING_INTERVAL: f64 = (SUBSCRIPTION_TIMER_RATE_MS as f64) / 1000.0;
pub const MIN_SAMPLING_INTERVAL: f64 = (SUBSCRIPTION_TIMER_RATE_MS as f64) / 1000.0;
pub const MAX_DATA_CHANGE_QUEUE_SIZE: usize = 10;
pub const DEFAULT_MONITORED_ITEM_CAPACITY: usize = 100;
pub const HELLO_TIMEOUT_POLL_MS: u64 = 500;
pub const MAX_SESSION_TIMEOUT: f64 = 60000f64;
pub const MAX_REQUEST_MESSAGE_SIZE: u32 = 32768;
pub const DEFAULT_KEEP_ALIVE_COUNT: u32 = 10;
pub const MAX_KEEP_ALIVE_COUNT: u32 = 30000;
pub const MAX_BROWSE_CONTINUATION_POINTS: usize = 20;
pub const MAX_HISTORY_CONTINUATION_POINTS: usize = 10;
pub const MAX_QUERY_CONTINUATION_POINTS: usize = 10;
pub const MAX_NODES_PER_TRANSLATE_BROWSE_PATHS_TO_NODE_IDS: usize = 10;
pub const MAX_NODES_PER_READ: usize = 50;
pub const MAX_NODES_PER_WRITE: usize = 10;
pub const MAX_NODES_PER_METHOD_CALL: usize = 10;
pub const MAX_NODES_PER_BROWSE: usize = 50;
pub const MAX_NODES_PER_REGISTER_NODES: usize = 10;
pub const MAX_NODES_PER_NODE_MANAGEMENT: usize = 100;
pub const MAX_MONITORED_ITEMS_PER_CALL: usize = 10;
pub const MAX_NODES_PER_HISTORY_READ_DATA: usize = 10;
pub const MAX_NODES_PER_HISTORY_READ_EVENTS: usize = 10;
pub const MAX_NODES_PER_HISTORY_UPDATE_DATA: usize = 10;
pub const MAX_NODES_PER_HISTORY_UPDATE_EVENTS: usize = 10;
}
#[cfg(test)]
mod tests;