Closed mycognosist closed 5 months ago
You can simply write a wrapper around a sync::Consumer
that implements local_nb::Consumer
. And then implement most consumers by wrapping the sync versions in that wrapper. Much fewer lines of code, and a nice utility for all users of the crate as well.
Analogous for producers as well, of course.
SyncToLocalNbConsumer
and SyncToLocalNbProducer
are not the greatest names, but not the worst either.
(There's little else for me to review, those wrappers would get around all that copypasted code that I'm now skipping over.)
The pipe functions don't need separate error types for sync, nb, and local, nb. Those should all use the same type, unless I'm missing something.
All looking good so far.
@AljoschaMeyer Any changes or additions you'd like to see here before merging?
I can do the consume_all()
helpers in a separate PR.
Looks good.
nb
:Send
local_nb
:!Send
SyncToLocalNbConsumer
andSyncToLocalNbProducer
wrapperstruct
slocal_nb
consumer implementationsCursor
IntoVec
IntoVecFallible
Invariant
InvariantNoop
Scramble
local_nb
producer implementationsCursor
Invariant
InvariantNoop
Scramble
local_nb
fuzzerscursors
invariant
invariant_noop
scramble_consumer
scramble_producer