Registry / utility / send-wrapper

send-wrapper

JSON →
library0.6.0rscratesunverified

A wrapper type that allows moving non-Send types between threads with runtime checks ensuring access and drop occur on the original thread.

# Cargo.toml [dependencies] send_wrapper = "0.6.0"
INSTALL
IMPORT
SIG · SEND-WRAPPER
S
send-wrapper
utilityrustv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SendWrapper
use send_wrapper::SendWrapper;

Wraps a non-Send value and moves it to another thread, panicking if accessed from wrong thread.

use send_wrapper::SendWrapper; let wrapper = SendWrapper::new(vec![1, 2, 3]); std::thread::spawn(move || { // Access only on original thread; here we just move it drop(wrapper); }).join().unwrap();
Debug
Known issues
gotchaPanics if the wrapped value is accessed from a thread other than the one where the SendWrapper was created.
fix
Ensure all access and drop happen on the original thread, or use alternative synchronization.
affects: >=0.1.0
Upgrade
Version history
0.6.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
send-wrapper — cargo add send-wrapper · libregistry