open62541 0.3.0

High-level, safe bindings for the C99 library open62541, an open source and free implementation of OPC UA (OPC Unified Architecture).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use open62541_sys::UA_SessionState;

/// Wrapper for secure channel state from [`open62541_sys`].
pub struct SessionState(UA_SessionState);

impl SessionState {
    /// Creates wrapper initialized with defaults.
    #[must_use]
    pub(crate) const fn init() -> Self {
        Self(UA_SessionState::UA_SESSIONSTATE_CLOSED)
    }

    /// Returns mutable pointer to value.
    #[must_use]
    pub(crate) fn as_mut_ptr(&mut self) -> *mut UA_SessionState {
        &mut self.0
    }
}