I am implementing code that keeps track of a sliding window of
Ts, for which I’m using a
VecDeque<T>. I’d like to be able to periodically clone/copy the contents of the
VecDeque<T> into an
Arc<[T]>, so that I can efficiently share the window with multiple threads and minimal indirection. My current best guess is to copy the
VecDeque<T> into a
Vec<T>, and then use
.into_boxed_slice(), but even then, I’m not sure that there’s a way to go from there to
Arc<[T]>. Any ideas on how to do this?
Thank you for your help!