Hi there,
I'm wondering, asPin
means (as far as I understood) the inner type is pinned in memory and not move-able which sounds to me that it would also be safe to use it across threads?! It implements Clone
as Arc
does.
Could anyone roughly elaborate what the high-level advantages and most suitable use cases are for the different variants:
Pin<Arc<T>>
Pin<Box<T>>
Arc<T>
?
My use case is that I'd like to pass the same structure into several closures that do execute somehow independently. This works fine with all three options - at least the compiler is fine but I'm wondering what would be a "best practice" kind of thing from an expert point of view ...
So any light shedding is much appreciated