| Crates.io | borrow-count |
| lib.rs | borrow-count |
| version | 0.1.0 |
| created_at | 2025-02-16 07:04:20.082909+00 |
| updated_at | 2025-02-16 07:04:20.082909+00 |
| description | Memory that can be shared with a smart pointer and then reaquired with a future. |
| homepage | |
| repository | https://github.com/Vi-Kitten/borrow-count |
| max_upload_size | |
| id | 1557421 |
| size | 26,075 |
Memory that can be shared with a smart pointer and then reaquired with a future.
let unique = Unique::new(0);
let (host, mut share) = unique.share_mut();
tokio::task::spawn(async move {
tokio::time::sleep(std::time::Duration::from_millis(16)).await;
*share += 1;
});
let unique = host.await;
assert_eq!(unique.into_inner(), 1)