ref_kind
Different reference kinds in Rust.
Provides 2 kinds of reference: immutable and mutable. All of them represented in one enum RefKind,
which allows you to store immutable and mutable references together.
In addition, this crate contains RefKindMap which is a HashMap of reference kinds.
This structure can easily be created from HashMap iterator (immutable or mutable one):
use HashMap;
use RefKindMap;
let mut map = new;
map.insert;
map.insert;
let mut refs = map.iter_mut.map.;
Then it can be used to retrieve multiple mutable references from the HashMap:
let hello = refs.move_mut.unwrap;
let answer = refs.move_mut.unwrap;
assert_eq!;
assert_eq!;
No unsafe code is needed!
License
Licensed under either of
- Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (http://opensource.org/licenses/MIT)
at your option.