duals 0.0.1

dual-ownership referance cells
Documentation

Duals

Dual-Ownership Reference Cells

These are similar to Rc and Arc, but ensure that only two references exist.

Example

use duals::Dual;

// create a new `Dual`
let (left, right) = Dual::new(10);

// use both
println!("{:?} {:?}", *left, *right);

// drop one reference
drop(left);

// we can still use the other
println!("{:?}", *right);

// drop the other reference; value is dropped
drop(right);