Duals
Dual-Ownership Reference Cells
These are similar to Rc
and Arc
, but ensure that only two references exist.
```rust 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); ```