Currently it’s possible to split slices at index and get the parts, even mutable slices since they don’t overlap.
Vec itself implements a
split_off method that allows the vector to be split at index, it however triggers an allocation of the new vector.
I’m interested in a method that would consume a
Vec<T> and produce two owned instances of
Vec<T> without the extra allocation step. Given an input vector of (pointer / capacity / length) = (N / 10 / 6), splitting it at offset 3 would produce a pair of (N / 3 / 3) and (N+3 / 7 / 3). Basically splitting the original allocated region between the two.
I’m still kind of new to how heap and stack works, is that even possible?