unsafe-ref

Crates.iounsafe-ref
lib.rsunsafe-ref
version1.0.0
sourcesrc
created_at2022-01-23 21:53:31.191801
updated_at2022-01-23 21:53:31.191801
descriptionAllow raw pointer access without those pesky unsafe blocks everywhere!
homepage
repositoryhttps://github.com/sjkillen/unsafe-ref-rust
max_upload_size
id519886
size4,439
(sjkillen)

documentation

README

unsafe-ref-rust

Allow raw pointer access without those pesky unsafe blocks everywhere!

let mut a = A(0);
let mut x: UnsafeMutRef<dyn Foo> = UnsafeMutRef::new(&mut a);
let mut y: UnsafeMutRef<dyn Foo> = UnsafeMutRef::new(&mut a);
let z: UnsafeRef<dyn Foo> = UnsafeRef::new(&a);
x.set(42);
y.set(z.get() + 10);
Commit count: 2

cargo fmt