-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework container builder to use push into
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. Signed-off-by: Moritz Hoffmann <[email protected]>
- Loading branch information
Showing
7 changed files
with
322 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.