pub trait Builtin {
// Required method
fn call(&mut self, args: &mut Args) -> Result<()>;
}
Expand description
The Builtin
trait contains the implementation for a bash builtin.
Required Methods§
Sourcefn call(&mut self, args: &mut Args) -> Result<()>
fn call(&mut self, args: &mut Args) -> Result<()>
Method invoked when the builtin is typed in the prompt.
It returns an instance of Result
. The value Ok(())
returns the
exit code 0
to the shell. Error::ExitCode
can be used to return a
specific exit code.
Any error type that implements std::error::Error
can be used with
the ?
operator to return an error from this method.
Command-line arguments are read from the Args
instance.