-
Notifications
You must be signed in to change notification settings - Fork 136
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
Allow accessing the inner ArrayVec
of a SequenceOf
#665
Comments
Are you specifically trying to avoid heap allocations? If not, then you can use |
Yes, I am avoiding heap allocations.
…On Sat, May 21, 2022, 19:44 Tony Arcieri ***@***.***> wrote:
Are you specifically trying to avoid heap allocations? If not, then you
can use Vec<u32> instead.
—
Reply to this email directly, view it on GitHub
<#665 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEZV2EHRZ6YLX6P5C642Y3VLGGPZANCNFSM5WST3YPQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Right now the I would prefer not to expose the current implementation. If we do expose it, I'd prefer to use either a crate like |
That makes sense. I might not get around to it until a bit, but would the goal be to replace the |
It might be possible. It would require some investigation, and is likely to require breaking changes, which I'd prefer not to make for awhile as I just cut a I would have a weak preference for Also: at present |
Hi Tony,
Unless I'm mistaken, in der version 0.6, the
inner
field of aSequenceOf
struct is not public: would it be possible to get a mutable pointer to that ArrayVec? From that, I think I should be able to call any of the methods ofslice
(e.g. thesort
method) on the underlying data since it implements theAsRef
structure. Is that correct?My use case is the following: I am building a lookup table of
u32
s, stored as aSequenceOf<u32, 256>
. Prior to encoding it, I want to ensure it's sorted so I can do a binary search on that data upon loading it.Another option would be for me to store the data as an
ArrayVec
and then initialize theSequenceOf
from thatArrayVec
(probably by moving the data) when encoding it, but that seems less straightforward.Thanks for your help
The text was updated successfully, but these errors were encountered: