I took a look at the API of the RingBuffer trait and I have some suggestions for cleanup before 1.0. Happy to make a PR for whatever subset of these changes you want (except the second one, I'd need to investigate that with one of you to fully figure that out):
[x] Swap push and enqueue. Since dequeue is a required method on RingBuffer, is makes sense that enqueue would be the required method and push the provided one.
[ ] len being provided is a bit confusing, because there's no way it can be derived from the required methods, at least not from the methods that show up in the docs. Something you might consider is splitting RingBuffer from UnsafeRingBuffer or something and "hide" methods that way, while still making it possible to see what's going on in the docs. Ideally though, the ptr_* methods would only be an implementation detail and should maybe not be part of the trait.
[ ] get_signed can probably be a provided method, based on length and get.
[ ] skip seems like it could be removed, because the drop can be done manually.
I took a look at the API of the
RingBuffer
trait and I have some suggestions for cleanup before 1.0. Happy to make a PR for whatever subset of these changes you want (except the second one, I'd need to investigate that with one of you to fully figure that out):push
andenqueue
. Sincedequeue
is a required method onRingBuffer
, is makes sense thatenqueue
would be the required method andpush
the provided one.len
being provided is a bit confusing, because there's no way it can be derived from the required methods, at least not from the methods that show up in the docs. Something you might consider is splittingRingBuffer
fromUnsafeRingBuffer
or something and "hide" methods that way, while still making it possible to see what's going on in the docs. Ideally though, theptr_*
methods would only be an implementation detail and should maybe not be part of the trait.get_signed
can probably be a provided method, based on length andget
.skip
seems like it could be removed, because the drop can be done manually.