Crates.io | unsafe-ref |
lib.rs | unsafe-ref |
version | 1.0.0 |
source | src |
created_at | 2022-01-23 21:53:31.191801 |
updated_at | 2022-01-23 21:53:31.191801 |
description | Allow raw pointer access without those pesky unsafe blocks everywhere! |
homepage | |
repository | https://github.com/sjkillen/unsafe-ref-rust |
max_upload_size | |
id | 519886 |
size | 4,439 |
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);