Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to access single SecretVec items #108

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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