#refcell #borrow #debugging #happen #standard #locations #builds

dioxus-debug-cell

A clone of the standard library’s RefCell type with extra debugging support in non-release builds. Whenever a borrow error happens the current locations of where known borrows were created will be printed out as well.

1 unstable release

0.1.1 Aug 1, 2023

#499 in Memory management

Download history 3839/week @ 2024-02-26 3467/week @ 2024-03-04 3147/week @ 2024-03-11 3217/week @ 2024-03-18 3690/week @ 2024-03-25 3806/week @ 2024-04-01 4314/week @ 2024-04-08 4463/week @ 2024-04-15 4456/week @ 2024-04-22 5023/week @ 2024-04-29 4110/week @ 2024-05-06 4337/week @ 2024-05-13 4368/week @ 2024-05-20 4172/week @ 2024-05-27 4670/week @ 2024-06-03 4069/week @ 2024-06-10

17,550 downloads per month
Used in 23 crates (via dioxus-hooks)

MIT/Apache

19KB
385 lines

debug-cell

Build Status

Documentation

A clone of the standard library's RefCell type with extra debugging support in non-release builds. Whenever a borrow error happens the current locations of where known borrows were created will be printed out as well.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

A clone of the standard library's RefCell type with extra debugging support in non-release builds.

Whenever a borrow error happens the current locations of where known borrows were created will be printed out as well.

Examples

use debug_cell::RefCell;

let r = RefCell::new(3);
let a = r.borrow();

// In debug builds this will print that the cell is currently borrowed
// above, and in release builds it will behave the same as the standard
// library's `RefCell`
let b = r.borrow_mut();

No runtime deps