Expand description
Heavy Lease Tracker - functionality for tracking borrows and providing more helpful errors on runtime borrowing/aliasing violations.
LeaseTrackertype, for use in smart cells likehv-cell’sAtomicRefCell(only on debug withtrack-leasesfeature enabled)Leasetype, for use in smart references/guard types likehv-cell’sAtomicRef/AtomicRefMutandArcRef/ArcRefMutOpenLeasetype, representing the origin of a dynamic borrow for diagnostic usage
no_std compatible, but requires alloc for Arcs, Cows, and Strings and uses spinlocks
internally to LeaseTracker for synchronizing adding/removing OpenLeases.
hv-lease-tracker is not a super performant crate, and should probably be disabled in your
release builds if performance of borrows is critical. It is strictly for diagnostic info.
Structs§
- Lease
- A handle to an
OpenLease. Created from aLeaseTracker, and carries an index pointing to debug information about that lease inside its tracker. This type is a drop guard and should be kept in your smart reference/guard type; when dropped, it removes its associated lease from its tracker. - Lease
Tracker - A registry which tracks the origins of dynamic borrows to provide better debug information on a borrow error.
- Open
Lease - An
OpenLeaserepresents the origin of an ongoing dynamic borrow. Stored as an entry for aLeaseinside aLeaseTracker.