#async #language #utility #concurrency

borrow-owned

Simple helper for temporary object moving

1 unstable release

0.1.0 Jun 21, 2021

#2102 in Rust patterns

MIT license

9KB
117 lines

Simple helper for temporary object moving in Rust

Crates.io Docs.rs MIT licensed Build Status

It is useful if you need to pass your object somewhere and you cannot pass a reference to the object because you wouldn't be able to guarantee that the object lives long enough. For example, you don't want to use Arc<Mutex<_>> for some reason but you need to pass your object to a new thread and you need to use the object again in the original thread once the new thread does not need the object anymore.

Dependencies

~20KB