[−][src]Trait endbasic_core::exec::BuiltinCommand
A trait to define a command that is executed by a Machine
.
The commands themselves are immutable but they can reference mutable state. Given that
EndBASIC is not threaded, it is sufficient for those references to be behind a RefCell
and/or an Rc
.
Required methods
pub fn name(&self) -> &'static str
[src]
Returns the name of the command, all in uppercase letters.
pub fn syntax(&self) -> &'static str
[src]
Returns a specification of the command's syntax.
pub fn description(&self) -> &'static str
[src]
Returns the usage message of the command.
#[must_use]pub fn exec<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Executes the command.
args
contains the arguments as provided in the invocation of the command. Each entry in
this array contains an optional expression (to support things like PRINT a, , b
) and the
separator that was used between that argument and the next. The last entry in args
always
has ArgSep::End
as the separator.
machine
provides mutable access to the current state of the machine invoking the command.
Commands cannot return any value except for errors.
Implementors
impl BuiltinCommand for ClsCommand
[src]
pub fn name(&self) -> &'static str
[src]
pub fn syntax(&self) -> &'static str
[src]
pub fn description(&self) -> &'static str
[src]
pub fn exec<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
_machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
_machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
impl BuiltinCommand for ColorCommand
[src]
pub fn name(&self) -> &'static str
[src]
pub fn syntax(&self) -> &'static str
[src]
pub fn description(&self) -> &'static str
[src]
pub fn exec<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
impl BuiltinCommand for InputCommand
[src]
pub fn name(&self) -> &'static str
[src]
pub fn syntax(&self) -> &'static str
[src]
pub fn description(&self) -> &'static str
[src]
pub fn exec<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
impl BuiltinCommand for LocateCommand
[src]
pub fn name(&self) -> &'static str
[src]
pub fn syntax(&self) -> &'static str
[src]
pub fn description(&self) -> &'static str
[src]
pub fn exec<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
impl BuiltinCommand for PrintCommand
[src]
pub fn name(&self) -> &'static str
[src]
pub fn syntax(&self) -> &'static str
[src]
pub fn description(&self) -> &'static str
[src]
pub fn exec<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
impl BuiltinCommand for ClearCommand
[src]
pub fn name(&self) -> &'static str
[src]
pub fn syntax(&self) -> &'static str
[src]
pub fn description(&self) -> &'static str
[src]
pub fn exec<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
impl BuiltinCommand for HelpCommand
[src]
pub fn name(&self) -> &'static str
[src]
pub fn syntax(&self) -> &'static str
[src]
pub fn description(&self) -> &'static str
[src]
pub fn exec<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
impl BuiltinCommand for ExitCommand
[src]
pub fn name(&self) -> &'static str
[src]
pub fn syntax(&self) -> &'static str
[src]
pub fn description(&self) -> &'static str
[src]
pub fn exec<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
args: &'life1 [(Option<Expr>, ArgSep)],
machine: &'life2 mut Machine
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,