#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

#516 in Memory management

Download history 2179/week @ 2024-07-19 2429/week @ 2024-07-26 2557/week @ 2024-08-02 2714/week @ 2024-08-09 2787/week @ 2024-08-16 2865/week @ 2024-08-23 3359/week @ 2024-08-30 2580/week @ 2024-09-06 2671/week @ 2024-09-13 2733/week @ 2024-09-20 2360/week @ 2024-09-27 2238/week @ 2024-10-04 2525/week @ 2024-10-11 2768/week @ 2024-10-18 2666/week @ 2024-10-25 1697/week @ 2024-11-01

10,009 downloads per month
Used in 29 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