pub struct NuLang {}
Implementations§
source§impl NuLang
impl NuLang
sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/basic.rs (line 14)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
fn main() {
// the remote supplied here currently does not support interactive passwords, use an ssh key
// without a password for now :((
let ssh_remote = env::var("SHRS_SSH_ADDRESS").unwrap();
let mux_plugin = MuxPlugin::new()
.register_lang("bash", BashLang::new())
.register_lang("python", PythonLang::new())
.register_lang("nu", NuLang::new())
.register_lang("ssh", SshLang::new(ssh_remote))
.register_lang("sqlite", SqliteLang::new(Path::new("/tmp/test.sqlite")));
let myshell = ShellBuilder::default()
.with_plugin(mux_plugin)
.build()
.unwrap();
myshell.run().unwrap();
}
Trait Implementations§
source§impl Lang for NuLang
impl Lang for NuLang
fn eval( &self, _sh: &Shell, _ctx: &mut Context, _rt: &mut Runtime, cmd: String ) -> Result<CmdOutput>
fn name(&self) -> String
source§fn needs_line_check(&self, _state: &LineStateBundle<'_>) -> bool
fn needs_line_check(&self, _state: &LineStateBundle<'_>) -> bool
Called when enter is pressed in line to check if the command is complete or needs another
line. Use
state.line.get_full_command()
Auto Trait Implementations§
impl Freeze for NuLang
impl RefUnwindSafe for NuLang
impl Send for NuLang
impl Sync for NuLang
impl Unpin for NuLang
impl UnwindSafe for NuLang
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more