| Crates.io | unsafe-send-sync |
| lib.rs | unsafe-send-sync |
| version | 0.2.0 |
| created_at | 2020-11-03 17:24:46.794021+00 |
| updated_at | 2025-07-03 16:23:55.778261+00 |
| description | Unsafe wrappers for making structs Send and/or Sync. |
| homepage | |
| repository | https://github.com/bamilab/unsafe-send-sync |
| max_upload_size | |
| id | 308324 |
| size | 6,323 |
This is a Rust package that basically provides 3 wrapper types.
They can be used to force structs to be Send and/or Sync, which is unsafe of course.
use std::thread;
use std::rc::Rc;
fn main() {
let not_send = UnsafeSend::new( Rc::<u32>::new( 1337 ) );
assert!( not_send.strong_count() == 1,
"We can't really send a reference counted pointer across threads unless it only has one reference." );
thread::spawn(move || {
println!("We found a number: {}", *not_send);
});
}