fragile

Crates.iofragile
lib.rsfragile
version1.2.2
sourcesrc
created_at2018-06-20 23:57:55.033266
updated_at2022-10-18 20:36:16.56158
descriptionProvides wrapper types for sending non-send values to other threads.
homepagehttps://github.com/mitsuhiko/fragile
repositoryhttps://github.com/mitsuhiko/fragile
max_upload_size
id71014
size28,288
Armin Ronacher (mitsuhiko)

documentation

README

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

Commit count: 59

cargo fmt