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

Fix lifetimes for NifEncoder and NifDecoder #3

Closed
hansihe opened this issue Jan 6, 2016 · 1 comment
Closed

Fix lifetimes for NifEncoder and NifDecoder #3

hansihe opened this issue Jan 6, 2016 · 1 comment

Comments

@hansihe
Copy link
Member

hansihe commented Jan 6, 2016

At the moment NifEncoder can't encode borrowed values that are not statically lived. NifDecoder should also be able to return values borrowed directly from the BEAM (this is safe as long as the borrow is of the same lifetime as the NifEnv object).

I tried a few things to make this work, but I am a bit unsure how lifetimes work in conjunction with traits. More experimentation is needed, I should get back to this later.

@hansihe
Copy link
Member Author

hansihe commented Jan 6, 2016

One consequence of fixing this issue is that it would allow NifEncoder to encode &strs that are not statically lived. Example: In ::map::make_ex_struct

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

No branches or pull requests

1 participant