use futures_core::future::BoxFuture;
use std::error::Error;
mod args;
mod async_io;
pub mod builtin;
mod cur_dir;
mod env_impl;
mod executable;
mod fd;
mod fd_manager;
mod fd_opener;
mod func;
mod last_status;
mod restorer;
mod string_wrapper;
mod var;
pub use self::args::{
ArgsEnv, ArgumentsEnvironment, SetArgumentsEnvironment, ShiftArgumentsEnvironment,
};
pub use self::async_io::{ArcUnwrappingAsyncIoEnv, AsyncIoEnvironment, TokioAsyncIoEnv};
pub use self::builtin::{Builtin, BuiltinEnvironment};
pub use self::cur_dir::{
ChangeWorkingDirectoryEnvironment, VirtualWorkingDirEnv, WorkingDirectoryEnvironment,
};
pub use self::env_impl::{
DefaultEnv, DefaultEnvArc, DefaultEnvConfig, DefaultEnvConfigArc, Env, EnvConfig,
};
pub use self::executable::{ExecutableData, ExecutableEnvironment, TokioExecEnv};
pub use self::fd::{FileDescEnv, FileDescEnvironment};
pub use self::fd_manager::{
FileDescManagerEnv, FileDescManagerEnvironment, TokioFileDescManagerEnv,
};
pub use self::fd_opener::{ArcFileDescOpenerEnv, FileDescOpener, FileDescOpenerEnv, Pipe};
pub use self::func::{
FnEnv, FnFrameEnv, FunctionEnvironment, FunctionFrameEnvironment, UnsetFunctionEnvironment,
};
pub use self::last_status::{LastStatusEnv, LastStatusEnvironment};
pub use self::restorer::{EnvRestorer, RedirectEnvRestorer, Restorer, VarEnvRestorer};
pub use self::string_wrapper::StringWrapper;
pub use self::var::{
ExportedVariableEnvironment, UnsetVariableEnvironment, VarEnv, VariableEnvironment,
};
pub trait IsInteractiveEnvironment {
fn is_interactive(&self) -> bool;
}
impl<'a, T: ?Sized + IsInteractiveEnvironment> IsInteractiveEnvironment for &'a T {
fn is_interactive(&self) -> bool {
(**self).is_interactive()
}
}
pub trait ReportErrorEnvironment {
fn report_error<'a>(
&mut self,
fail: &'a (dyn Error + Sync + Send + 'static),
) -> BoxFuture<'a, ()>;
}
impl<'b, T: ?Sized + ReportErrorEnvironment> ReportErrorEnvironment for &'b mut T {
fn report_error<'a>(
&mut self,
fail: &'a (dyn Error + Sync + Send + 'static),
) -> BoxFuture<'a, ()> {
(**self).report_error(fail)
}
}
pub trait SubEnvironment: Sized {
fn sub_env(&self) -> Self;
}