You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
leanify-many/src/process.rs

35 lines
807 B

//! Handles spawning the process
/// Spawn the process, and contain its standard output.
///
/// # Notes
/// Standard error is printed immediately instead.
pub async fn contained_spawn<T,U,V>(process: T, args: U) -> Result<StdoutCache, Error>
where T: AsRef<str>,
U: IntoIterator<Item=V>,
T: AsRef<str>
{
}
#[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"),
}
}
}