Skip to content

Add functions to access single SecretVec items#108

Open
Bennett-Petzold wants to merge 3 commits intostouset:masterfrom
Bennett-Petzold:pr-1
Open

Add functions to access single SecretVec items#108
Bennett-Petzold wants to merge 3 commits intostouset:masterfrom
Bennett-Petzold:pr-1

Conversation

@Bennett-Petzold
Copy link

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant