This crate provides low-level, unsafe bindings for the C11 library open62541, an open source and free implementation of OPC UA.
Use this crate when you want to implement your own safe Rust abstractions over the unsafe C API provided by open62541.
If you are looking for safe Rust bindings that can be used directly, see crate open62541
(crates.io,
GitHub).
Make sure to check out the repository open62541-sys with submodules:
git submodule update --init --recursiveWhen the Rust code is built with AddressSanitizer enabled (nightly -Zsanitizer=address), the
bundled C libraries are instrumented as well (with -fsanitize=address -fno-omit-frame-pointer). No
other configuration is necessary:
RUSTFLAGS="-Zsanitizer=address" cargo +nightly test \
--target "$(rustc +nightly -vV | sed -n 's/^host: //p')"The sanitizer runtime is provided by the LLVM version bundled with Rust, so the C compiler must be compatible with it. Otherwise, linking fails with an undefined symbol like this one (seen with the default Apple Clang on macOS):
Undefined symbols for architecture arm64:
"___asan_version_mismatch_check_apple_clang_2100", referenced from: ...
To resolve this, select a Clang matching the LLVM major version that rustc +nightly -vV reports
(line LLVM version) by setting CC (or CC_<target>, as supported by the
cc crate). For example, with LLVM from Homebrew on macOS:
CC="$(brew --prefix llvm)/bin/clang" RUSTFLAGS="-Zsanitizer=address" cargo +nightly test \
--target "$(rustc +nightly -vV | sed -n 's/^host: //p')"