Trait nu_protocol::engine::Command

source ·
pub trait Command: Send + Sync + CommandClone {
Show 21 methods // Required methods fn name(&self) -> &str; fn signature(&self) -> Signature; fn usage(&self) -> &str; fn run( &self, engine_state: &EngineState, stack: &mut Stack, call: &Call, input: PipelineData, ) -> Result<PipelineData, ShellError>; // Provided methods fn extra_usage(&self) -> &str { ... } fn run_const( &self, working_set: &StateWorkingSet<'_>, call: &Call, input: PipelineData, ) -> Result<PipelineData, ShellError> { ... } fn examples(&self) -> Vec<Example<'_>> { ... } fn search_terms(&self) -> Vec<&str> { ... } fn is_const(&self) -> bool { ... } fn is_sub(&self) -> bool { ... } fn block_id(&self) -> Option<BlockId> { ... } fn as_alias(&self) -> Option<&Alias> { ... } fn plugin_identity(&self) -> Option<&PluginIdentity> { ... } fn command_type(&self) -> CommandType { ... } fn is_builtin(&self) -> bool { ... } fn is_custom(&self) -> bool { ... } fn is_keyword(&self) -> bool { ... } fn is_known_external(&self) -> bool { ... } fn is_alias(&self) -> bool { ... } fn is_plugin(&self) -> bool { ... } fn pipe_redirection(&self) -> (Option<OutDest>, Option<OutDest>) { ... }
}

Required Methods§

source

fn name(&self) -> &str

source

fn signature(&self) -> Signature

source

fn usage(&self) -> &str

source

fn run( &self, engine_state: &EngineState, stack: &mut Stack, call: &Call, input: PipelineData, ) -> Result<PipelineData, ShellError>

Provided Methods§

source

fn extra_usage(&self) -> &str

source

fn run_const( &self, working_set: &StateWorkingSet<'_>, call: &Call, input: PipelineData, ) -> Result<PipelineData, ShellError>

Used by the parser to run command at parse time

If a command has is_const() set to true, it must also implement this method.

source

fn examples(&self) -> Vec<Example<'_>>

source

fn search_terms(&self) -> Vec<&str>

source

fn is_const(&self) -> bool

source

fn is_sub(&self) -> bool

source

fn block_id(&self) -> Option<BlockId>

source

fn as_alias(&self) -> Option<&Alias>

source

fn plugin_identity(&self) -> Option<&PluginIdentity>

The identity of the plugin, if this is a plugin command

source

fn command_type(&self) -> CommandType

source

fn is_builtin(&self) -> bool

source

fn is_custom(&self) -> bool

source

fn is_keyword(&self) -> bool

source

fn is_known_external(&self) -> bool

source

fn is_alias(&self) -> bool

source

fn is_plugin(&self) -> bool

source

fn pipe_redirection(&self) -> (Option<OutDest>, Option<OutDest>)

Trait Implementations§

source§

impl Clone for Box<dyn Command>

source§

fn clone(&self) -> Box<dyn Command>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§