rush/src/lib.rs

38 lines
739 B
Rust

//! The Rush shell.
pub mod env;
pub mod exec;
pub mod eval;
use env::job;
/// Attempt to execute a program, rush expression or builtin.
pub fn exec (prog: impl exec::Exec) -> Result<job::Job<job::Running>> {
todo!()
}
pub use err::{
Error,
Result,
};
mod err {
/// A global union type of errors produced anywhere within the Rush shell.
#[derive(Debug)]
pub enum Error {
Io (std::io::Error)
}
impl From<std::io::Error> for Error {
fn from (err: std::io::Error) -> Self {
Error::Io (err)
}
}
/// A less verbose way to use the [`Result`](std::result::Result) type with
/// an [`Error`].
pub type Result<T, E = Error> = std::result::Result<T, E>;
}