borrow-count

Crates.ioborrow-count
lib.rsborrow-count
version0.1.0
created_at2025-02-16 07:04:20.082909+00
updated_at2025-02-16 07:04:20.082909+00
descriptionMemory that can be shared with a smart pointer and then reaquired with a future.
homepage
repositoryhttps://github.com/Vi-Kitten/borrow-count
max_upload_size
id1557421
size26,075
Kit (Vi-Kitten)

documentation

README

Borrow Count

Memory that can be shared with a smart pointer and then reaquired with a future.

Example

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)
Commit count: 3

cargo fmt