pub trait Lang {
// Required methods
fn eval(
&self,
sh: &Shell,
ctx: &mut Context,
rt: &mut Runtime,
cmd: String
) -> Result<CmdOutput>;
fn name(&self) -> String;
fn needs_line_check(&self, state: &LineStateBundle<'_>) -> bool;
}
Expand description
Trait to implement a shell command language
Required Methods§
fn eval( &self, sh: &Shell, ctx: &mut Context, rt: &mut Runtime, cmd: String ) -> Result<CmdOutput>
fn name(&self) -> String
sourcefn 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()