Exidex
Exidex10mo ago

Can extension state have fields that require passing lifetime?

It is possible to pass bounds and parameters to the extension! macro but as far as I see it doesn't support lifetimes?
2 Replies
Exidex
Exidex10mo ago
ah, GothamState requires static lifetime. so that is a bigger problem. I wonder if it can be worked around somehow. My use case is using zbus Proxy inside of an op. but pretty much every struct in that crate has a a lifetime
mmastrac
mmastrac10mo ago
The lifetime of the runtime is effectively static so there's no really great way to use non-static lifetimes in ops. Your best bet is either running it in a thread you control and passing messages to it, or making use of a Box/Yoke to get a lifetime that's 'static.