You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Making code flexible around heapless structures can be a bit verbose because it requires being generic over the capacity of each collection. This could be helped by providing versions of the structures with the const erased. This would allow removing the generics in some cases.
With VecView implementing most of the API that Vec currently implements. This would allow for example methods that write data to an outbuffer of type &mut Vec<T, N> to instead take a parameter VecView<'_, T>.
Making code flexible around heapless structures can be a bit verbose because it requires being generic over the capacity of each collection. This could be helped by providing versions of the structures with the
const
erased. This would allow removing the generics in some cases.For example,
heapless::Vec
currently is :It should be possible to provide a struct that goes hand in hand with it:
With
VecView
implementing most of the API that Vec currently implements. This would allow for example methods that write data to an outbuffer of type&mut Vec<T, N>
to instead take a parameterVecView<'_, T>
.Something like:
could become
In a trait for example this would also have the advantage of making it object-safe.
I believe this pattern:
The text was updated successfully, but these errors were encountered: