//! Handles spawning the process /// Spawn the process, and contain its standard output. /// /// # Notes /// Standard error is printed immediately instead. pub async fn contained_spawn(process: T, args: U) -> Result where T: AsRef, U: IntoIterator, T: AsRef { } #[derive(Debug)] pub enum Error { /// There was an error spawning the process Spawning, /// Process exited with non-zero error code. Process, } impl std::error::Error for Error{} impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Spawning => write!(f, "there was an error spawning the process"), Self::Process => write!(f, "process exited with non-zero code"), } } }