secrets icon indicating copy to clipboard operation
secrets copied to clipboard

Add functions to access single SecretVec items

Open Bennett-Petzold opened this issue 1 year ago • 0 comments

Currently SecretVec only allows borrowing an (im)mutable wrapper around the box slice. This means any struct using a SecretVec and holding open references to content inside need to hold both the borrowed SecretVec and the Box borrow produced by its methods. This commit adds get, get_mut, and an iterator for direct access to items without the Box borrow indirection. The types ItemRef and ItemRefMut preserve the locking rules while acting as a handle to individual values in the Box.

Bennett-Petzold avatar Jul 02 '24 18:07 Bennett-Petzold