#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

#489 in Memory management

Download history 2804/week @ 2024-03-14 3369/week @ 2024-03-21 3800/week @ 2024-03-28 3932/week @ 2024-04-04 4696/week @ 2024-04-11 4237/week @ 2024-04-18 4926/week @ 2024-04-25 4671/week @ 2024-05-02 4059/week @ 2024-05-09 4477/week @ 2024-05-16 4325/week @ 2024-05-23 4581/week @ 2024-05-30 4250/week @ 2024-06-06 4659/week @ 2024-06-13 4857/week @ 2024-06-20 3325/week @ 2024-06-27

18,073 downloads per month
Used in 24 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