Crates.io | mappable-rc |
lib.rs | mappable-rc |
version | 0.1.1 |
source | src |
created_at | 2022-01-22 00:05:35.829125 |
updated_at | 2023-02-28 06:51:39.937246 |
description | Provides mappable reference counted types |
homepage | |
repository | https://github.com/JakobDegen/mappable-rc |
max_upload_size | |
id | 518806 |
size | 33,116 |
Provides mappable Rc
and Arc
types.
use mappable_rc::Mrc;
let m: Mrc<[u32]> = vec![1, 2, 3, 4].into();
assert_eq!(m.as_ref(), &[1, 2, 3, 4]);
let m: Mrc<[u32]> = Mrc::map(m, |slice| &slice[1..=2]);
assert_eq!(m.as_ref(), &[2, 3]);