fragile 1.2.2

Provides wrapper types for sending non-send values to other threads.
Documentation

Fragile

Build Status Crates.io License rustc 1.42.0 Documentation

This library provides wrapper types that permit sending non Send types to other threads and use runtime checks to ensure safety.

Example

use std::thread;

// creating and using a fragile object in the same thread works
let val = Fragile::new(true);
assert_eq!(*val.get(), true);
assert!(val.try_get().is_ok());

// once send to another thread it stops working
thread::spawn(move || {
    assert!(val.try_get().is_err());
}).join()
    .unwrap();

License and Links