sharded-slab icon indicating copy to clipboard operation
sharded-slab copied to clipboard

consider adding a `Guard` method to clear/remove the entry

Open hawkw opened this issue 4 years ago • 1 comments

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.

hawkw avatar Apr 04 '20 18:04 hawkw

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)?

eggyal avatar Dec 07 '23 19:12 eggyal