Crate debug_cell [−] [src]
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();
Structs
Ref |
Wraps a borrowed reference to a value in a |
RefCell |
A clone of the standard library's |
RefMut |
A wrapper type for a mutably borrowed value from a |
Enums
BorrowState |
An enumeration of values returned from the |