Skip to content

Commit

Permalink
Input: add ChildContainer::new (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
asg0451 authored Jan 12, 2022
1 parent 00295bd commit ecc47d5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/input/child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ use tracing::debug;
#[derive(Debug)]
pub struct ChildContainer(Vec<Child>);

pub(crate) fn children_to_reader<T>(children: Vec<Child>) -> Reader {
impl ChildContainer {
/// Create a new [`ChildContainer`] from a child process
pub fn new(children: Vec<Child>) -> Self {
Self(children)
}
}

/// Create a [`Reader`] from a child process
pub fn children_to_reader<T>(children: Vec<Child>) -> Reader {
Reader::Pipe(BufReader::with_capacity(
STEREO_FRAME_SIZE * mem::size_of::<T>() * CHILD_BUFFER_LEN,
ChildContainer(children),
Expand Down

0 comments on commit ecc47d5

Please sign in to comment.