refmove: an experimental implementation of library-level by-move references

Build Status Latest Version

This crate contains an experimental implementation of library-level by-move references.

It will enable you to use self: RefMove<Self> to pass your trait object by value, even without allocation.

See #48055 for another approach to allow by-value trait objects.

Usage

Borrowing

```rust

![feature(nll)]

extern crate refmove; use refmove::{Anchor, AnchorExt, RefMove};

...

// Borrowing from stack let : RefMove = 42.anchor().borrowmove();

// Borrowing from box let : RefMove = Box::new(42).anchorbox().borrow_move(); ```

Extracting

```rust

![feature(nll)]

extern crate refmove; use refmove::{Anchor, AnchorExt, RefMove};

...

fn f(x: RefMove) { // Borrowing by dereference println!("{}", &x as &String);

// Move out ownership
let _: String = x.into_inner();

} ```