Struct shrs_mux::NuLang

source ·
pub struct NuLang {}

Implementations§

source§

impl NuLang

source

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

source§

fn eval( &self, _sh: &Shell, _ctx: &mut Context, _rt: &mut Runtime, cmd: String ) -> Result<CmdOutput>

source§

fn name(&self) -> String

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsAny for T
where T: Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> ExactFrom<T> for U
where U: TryFrom<T>,

source§

fn exact_from(value: T) -> U

source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

source§

fn exact_into(self) -> U

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

source§

fn wrapping_into(self) -> U