Crates.io | libcryptsetup-rs |
lib.rs | libcryptsetup-rs |
version | 0.11.0 |
source | src |
created_at | 2020-01-10 03:06:37.509362 |
updated_at | 2024-10-04 16:57:52.565856 |
description | High level Rust bindings for libcryptsetup |
homepage | https://stratis-storage.github.io/ |
repository | https://github.com/stratis-storage/libcryptsetup-rs |
max_upload_size | |
id | 197055 |
size | 240,768 |
This crate provides Rust bindings for libcryptsetup.
libcryptsetup is not thread-safe and also depends on libraries that are not thread-safe. Any use of libcryptsetup by default in a multithreaded environment will result in undefined behavior.
As a workaround, this library provides a feature (mutex
) to cause all calls to
libcryptsetup to acquire a crate-level mutex. This will enforce single threaded
access to all invocations of the libcryptsetup API.
Rust's decision to make pointers !Send
should be respected. Any data structure that
contains a pointer is not safe to send across threads. Providing an unsafe impl Send {}
for any data structure provided by libcryptsetup-rs that is not Send
may result in undefined behavior.
The libcryptsetup bindings require some dependencies outside of cargo to build properly:
cryptsetup
on Fedora)cryptsetup-devel
on Fedora)clang
on Fedora)There is one test that actually invokes libcryptsetup and can be used for basic sanity testing of the bindings as it will only succeed if low level bindings are correctly generated, the high level bindings build, and libcryptsetup successfully encrypts a loopback device.
This can be invoked as follows:
make test-loopback