sendable icon indicating copy to clipboard operation
sendable copied to clipboard

sendable Weak Reference

Open gftea opened this issue 2 years ago • 3 comments

Hi,

it seems there is no sendable Weak reference?

gftea avatar Apr 25 '23 06:04 gftea

There isn't (they weren't needed for the use case this crate was developed for), but I believe one could be added in a straightforward way.

hniksic avatar Apr 25 '23 07:04 hniksic

When we have a cyclic data structure, which T has a field with weak reference to itself, then we need a SendWeak to make SendRc<T> sendable

gftea avatar Apr 25 '23 08:04 gftea

That makes sense. Do you use SendRc in production, or plan to do so? Do you find it useful?

I could look into adding support for weak references, but would only do that if it will be of practical use.

hniksic avatar Apr 25 '23 12:04 hniksic