Struct MuxPlugin

Source
pub struct MuxPlugin { /* private fields */ }

Implementations§

Source§

impl MuxPlugin

Source

pub fn new() -> Self

Examples found in repository?
examples/basic.rs (line 11)
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();
}
Source

pub fn register_lang(self, name: &str, lang: impl Lang + 'static) -> Self

Examples found in repository?
examples/basic.rs (line 12)
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();
}
Source

pub fn register_theme( self, name: &str, syntax_theme: Box<dyn SyntaxTheme>, ) -> Self

Trait Implementations§

Source§

impl Plugin for MuxPlugin

Source§

fn init(&self, shell: &mut ShellConfig) -> Result<()>

Plugin initialization Read more
Source§

fn post_init(&self, _sh: &mut Shell, _states: &mut States) -> Result<(), Error>

Plugin post initialization Read more
Source§

fn meta(&self) -> PluginMeta

Return metadata related to the plugin
Source§

fn fail_mode(&self) -> FailMode

Get the fail mode for this plugin Read more

Auto Trait Implementations§

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.
Source§

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>,

Source§

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>,

Source§

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