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

Why is Device trait specified for all lifetimes ? #688

Closed
gopakumarce opened this issue Oct 1, 2022 · 2 comments
Closed

Why is Device trait specified for all lifetimes ? #688

gopakumarce opened this issue Oct 1, 2022 · 2 comments

Comments

@gopakumarce
Copy link

gopakumarce commented Oct 1, 2022

Hi,

The thread below illustrates a use case where a third party Device structure can have borrowed data with its own lifetimes. And this makes it impossible to implement the Device trait for such a structure. Also it need not be a reference to the packet itself as mentioned in the thread below, basically a third party device structure cannot have any kind of references :(

https://users.rust-lang.org/t/implementing-a-trait-for-all-lifetimes-of-the-struct/45045

I cant see why the Device trait is mentioned as "for all lifetimes", can anything be done to support this pls ?

Rgds,
Gopa.

@gopakumarce
Copy link
Author

Just to add that if it sounds ok to have the device not be over all lifetimes, I can take a crack at making the required changes and send it across

@gopakumarce
Copy link
Author

I see that @Dirbaio has tried to address this in #572 ! That's awesome, I hope that gets in once GAT is available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant