mirror of
https://github.com/nushell/nushell
synced 2025-01-10 12:19:14 +00:00
17 lines
572 B
Rust
17 lines
572 B
Rust
|
use crate::commands::command::CallInfo;
|
||
|
use crate::errors::ShellError;
|
||
|
use crate::stream::{InputStream, OutputStream};
|
||
|
use rustyline::{completion::Completer, hint::Hinter};
|
||
|
|
||
|
pub trait Shell
|
||
|
where
|
||
|
Self: Completer<Candidate = rustyline::completion::Pair>,
|
||
|
Self: Hinter,
|
||
|
{
|
||
|
fn name(&self) -> String;
|
||
|
fn ls(&self, call_info: CallInfo, input: InputStream) -> Result<OutputStream, ShellError>;
|
||
|
fn cd(&self, call_info: CallInfo, input: InputStream) -> Result<OutputStream, ShellError>;
|
||
|
fn path(&self) -> String;
|
||
|
fn set_path(&mut self, path: String);
|
||
|
}
|