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

JsonValue is not owned #7

Open
vitiral opened this issue Feb 13, 2019 · 1 comment
Open

JsonValue is not owned #7

vitiral opened this issue Feb 13, 2019 · 1 comment

Comments

@vitiral
Copy link

vitiral commented Feb 13, 2019

Hey, thanks for the great library.

JsonValue is not currently owned, as it requires a lifetime. The docs say it is owned though 😄

https://docs.rs/jsonnet-rs/0.6.0/jsonnet/struct.JsonValue.html

@vitiral vitiral changed the title JsonnetValue is not owned JsonValue is not owned Feb 13, 2019
@anguslees
Copy link
Owner

anguslees commented Sep 2, 2020

Yes, true - in the sense that it's not 'static. I was trying to communicate that JsonValue frees the underlying jsonnet value when the JsonValue object is dropped - unlike JsonVal which just "borrows" the underlying jsonnet value. The JsonValue lifetime points to the parent JsonnetVm and not the internally-referenced jsonnet value.

I agree that's confusing when a reader (quite reasonably!) assumes a strict interpretation of "owned" and I should clarify that further in the docs.

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

2 participants