-
Notifications
You must be signed in to change notification settings - Fork 7
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
tezos-encoding + derive: keep track of lifetime in NomReader #46
Conversation
tezos-encoding/src/nom.rs
Outdated
deserialized: Option<T>, | ||
} | ||
|
||
impl<'a, T> NomReader<'a> for LazyCell<'a, T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally would have a impl From<T> for
LazyCell`?
and a BinWriter
for LazyCell
which internally would 'fail' the value if not present.
Thanks for the PR! Overall a big fan of adding something like this. Pretty happy with the first commit - most comments focused on the second (perhaps could be split out into a second PR if needed) |
Thanks for the review. I agree to split this in two PRs. |
6359e45
to
cc63f5f
Compare
I've removed the second commit. All remaining comments are now outdated if I am not mistaken. |
The `NomReader` trait is implicitly parameterized by the lifetime of the input byte slice. This commit makes the quantification on this explicit. This is needed to implement `NomReader` for structures which keep a reference to some slice of the input, for example to implement lazy deserialization.
cc63f5f
to
6cb8c5e
Compare
The
NomReader
trait is implicitly parameterized by the lifetime of the input byte slice. This commit makes the quantification on this explicit. This is needed to implementNomReader
for structures which keep a reference to some slice of the input, for example to implement lazy deserialization.