eater-arc-illegal 0.1.0

An Arc that allows multiple mutable references (illegal!)
Documentation
  • Coverage
  • 85.71%
    18 out of 21 items documented1 out of 21 items with examples
  • Size
  • Source code size: 12.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 786.72 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • EaterLabs/arc-illegal
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • the-eater

eater's Arc Illegal

It's made of crimes. and gay.

Do you ever feel like you need an Arc, but don't need a Mutex or RwLock because you know better?

ArcIllegal is for you!

ArcIllegal works like an Arc but instead lets you use the held value as mutable! and all via safe* code!

Complete with a few convenience methods!

use eater_arc_illegal::arc;

fn main() {
    let mut shared_num = arc(4);
    let mut cloned = shared_num.dup();
    *shared_num += 2;

    std::thread::spawn(move || {
        *cloned += 2;
    });

    std::thread::sleep(std::time::Duration::from_secs(1));

    assert_eq!(8, *shared_num);
}

* Code inside this library is not safe.