pub trait Cli: Sync + Send {
// Required methods
fn digest<'async_trait>(
self: Arc<Self>,
term: Arc<Terminal>,
cmd: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait;
fn complete<'async_trait>(
self: Arc<Self>,
term: Arc<Terminal>,
cmd: String,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>>> + Send + 'async_trait>>
where Self: 'async_trait;
fn prompt(&self) -> Option<String>;
// Provided method
fn init(self: Arc<Self>, _term: &Arc<Terminal>) -> Result<()> { ... }
}Expand description
User-implemented command-line processor driven by a Terminal.
An implementation receives the user’s input lines and is responsible for parsing, executing, and providing completion candidates for commands.
Required Methods§
Sourcefn digest<'async_trait>(
self: Arc<Self>,
term: Arc<Terminal>,
cmd: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
fn digest<'async_trait>(
self: Arc<Self>,
term: Arc<Terminal>,
cmd: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
Processes a single command line entered by the user.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".