Previously, ContainerBuilder had push and push_container functions,
which were odd in the presence of the PushInto trait. This change removes
the functions and instead relies on a PushInto implementation. As a
bonus, this removes several SizableContainer bounds, which are now
up to the caller to enforce should they push into a capacity-based
container builder.
Specifically, it adds the following new types or APIs:
ContainerBuilder: remove push and push_container. Replaces the fromer
with a PushInto implementation, and moves the latter into a function
on CapacityContainerBuilder. All uses of give_container are now
special-cased to said builder. Other builders can accept containers
through their PushInto implementation.
A BufferingContainerBuilder that only accepts complete buffers. Could
back out that change because it's similar (but not equal!) to the
capacity-based variant.
core::Input learns new_input_with_buider that allows the user to
specify a customer builder. Existing APIs should function unchanged and
use the capacity-based builder.
core::SharedStream uses the buffering container builder.
core::to_stream gains a ToStreamBuilder trait that allows the user to
specify the builder. ToStream uses that but fixes the builder to the
capacity-based variant.
Previously,
ContainerBuilder
hadpush
andpush_container
functions, which were odd in the presence of thePushInto
trait. This change removes the functions and instead relies on aPushInto
implementation. As a bonus, this removes severalSizableContainer
bounds, which are now up to the caller to enforce should they push into a capacity-based container builder.Specifically, it adds the following new types or APIs:
push
andpush_container
. Replaces the fromer with aPushInto
implementation, and moves the latter into a function onCapacityContainerBuilder
. All uses ofgive_container
are now special-cased to said builder. Other builders can accept containers through theirPushInto
implementation.BufferingContainerBuilder
that only accepts complete buffers. Could back out that change because it's similar (but not equal!) to the capacity-based variant.new_input_with_buider
that allows the user to specify a customer builder. Existing APIs should function unchanged and use the capacity-based builder.ToStreamBuilder
trait that allows the user to specify the builder.ToStream
uses that but fixes the builder to the capacity-based variant.Signed-off-by: Moritz Hoffmann antiguru@gmail.com