mappable-rc

Crates.iomappable-rc
lib.rsmappable-rc
version0.1.1
sourcesrc
created_at2022-01-22 00:05:35.829125
updated_at2023-02-28 06:51:39.937246
descriptionProvides mappable reference counted types
homepage
repositoryhttps://github.com/JakobDegen/mappable-rc
max_upload_size
id518806
size33,116
Jakob Degen (JakobDegen)

documentation

README

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]);
Commit count: 6

cargo fmt