Split nu-cli into nu-cli/nu-engine (#2898)

We split off the evaluation engine part of nu-cli into its own crate. This helps improve build times for nu-cli by 17% in my tests. It also helps us see a bit better what's the core engine portion vs the part specific to the interactive CLI piece.

There's more than can be done here, but I think it's a good start in the right direction.
This commit is contained in:
Jonathan Turner
2021-01-10 15:50:49 +13:00
committed by GitHub
parent 9de2144fc4
commit 93e8f6c05e
280 changed files with 1890 additions and 1750 deletions

View File

@ -33,3 +33,16 @@ impl<V> Stream for InterruptibleStream<V> {
}
}
}
pub trait Interruptible<V> {
fn interruptible(self, ctrl_c: Arc<AtomicBool>) -> InterruptibleStream<V>;
}
impl<S, V> Interruptible<V> for S
where
S: Stream<Item = V> + Send + 'static,
{
fn interruptible(self, ctrl_c: Arc<AtomicBool>) -> InterruptibleStream<V> {
InterruptibleStream::new(self, ctrl_c)
}
}