From ecc47d588ab4bf492cf72d13e1dc0f039f4f3aab Mon Sep 17 00:00:00 2001 From: Miles Frankel Date: Wed, 12 Jan 2022 05:58:59 -0500 Subject: [PATCH] Input: add ChildContainer::new (#108) --- src/input/child.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/input/child.rs b/src/input/child.rs index d63fa4f..1a2ccb0 100644 --- a/src/input/child.rs +++ b/src/input/child.rs @@ -20,7 +20,15 @@ use tracing::debug; #[derive(Debug)] pub struct ChildContainer(Vec); -pub(crate) fn children_to_reader(children: Vec) -> Reader { +impl ChildContainer { + /// Create a new [`ChildContainer`] from a child process + pub fn new(children: Vec) -> Self { + Self(children) + } +} + +/// Create a [`Reader`] from a child process +pub fn children_to_reader(children: Vec) -> Reader { Reader::Pipe(BufReader::with_capacity( STEREO_FRAME_SIZE * mem::size_of::() * CHILD_BUFFER_LEN, ChildContainer(children),