open62541 0.6.2

High-level, safe bindings for the C99 library open62541, an open source and free implementation of OPC UA (OPC Unified Architecture).
Documentation
use open62541_sys::UA_SecureChannelState;

/// Wrapper for [`UA_SecureChannelState`] from [`open62541_sys`].
#[derive(Debug)]
pub struct SecureChannelState(UA_SecureChannelState);

impl SecureChannelState {
    /// Creates wrapper initialized with defaults.
    #[must_use]
    #[allow(dead_code)] // --no-default-features
    pub(crate) const fn init() -> Self {
        // Use default variant that corresponds to numeric value `0` to match other `init()` calls.
        Self(UA_SecureChannelState::UA_SECURECHANNELSTATE_CLOSED)
    }

    /// Returns mutable pointer to value.
    #[must_use]
    #[allow(dead_code)] // --no-default-features
    pub(crate) fn as_mut_ptr(&mut self) -> *mut UA_SecureChannelState {
        &mut self.0
    }
}