rush/src/lib.rs

38 lines
739 B
Rust
Raw Normal View History

2021-07-05 21:46:21 +02:00
//! The Rush shell.
2021-07-05 22:17:49 +02:00
pub mod env;
pub mod exec;
pub mod eval;
2021-07-05 21:46:21 +02:00
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>;
}