Bound
A minimal crate to encapsulate the act of deriving a struct from a reference. Notably useful
for wrapping LockGuard instances obtained from Arc<RwLock<T>> for example, but essentially
works with anything that has a similar relation as the LockGuard does to the RwLock.
Usage
This and all other examples are also available on https:://docs.rs/bound
use ;
use Bound;
let shared = new;
let mut writer = try_new.expect;
*writer = 2;
// writer now has the following type
type Writer =
You can now safely pass writer around and put it in structs, something you couldn't do with an
RwLockWriteGuard by default because it's derived from the local reference to its lock.