Since a guard has a reference to the slab and knows the index of the entry, it should be possible to add a method to mark the entry to be cleared. This would drop the guard, since the entry may no longer be accessible. This could be a little more ergonomic than having to call the clear/remove method on the Slab/Pool in some cases.
Short of adding such a method, could the guards at least expose a getter method for the slab/pool (currently I'm wrapping it up together with a reference thereto in a newtype, which is just needlessly wasteful)?
Since a guard has a reference to the slab and knows the index of the entry, it should be possible to add a method to mark the entry to be cleared. This would drop the guard, since the entry may no longer be accessible. This could be a little more ergonomic than having to call the
clear
/remove
method on theSlab
/Pool
in some cases.