pub trait App: Sized {
type Msg: Send + 'static;
type Panel: Panel;
Show 13 methods
// Required methods
fn commands(&self) -> Vec<CommandInfo>;
fn run(&mut self, line: &str, ctx: &mut Ctx<'_, Self>);
// Provided methods
fn launch(&mut self, ctx: &mut Ctx<'_, Self>) { ... }
fn done(&mut self, msg: Self::Msg, ctx: &mut Ctx<'_, Self>) { ... }
fn panel_event(
&mut self,
event: <Self::Panel as Panel>::Event,
ctx: &mut Ctx<'_, Self>,
) { ... }
fn tick(&mut self, ctx: &mut Ctx<'_, Self>) { ... }
fn refresh(&mut self) { ... }
fn header(&self) -> Vec<Row> ⓘ { ... }
fn notices(&self) -> Vec<Notice> { ... }
fn footer(&self) -> String { ... }
fn placeholder(&self) -> String { ... }
fn completer(&self) -> &dyn Completer { ... }
fn crashed(&self) -> String { ... }
}Expand description
What the app tells the shell.
Required Associated Types§
Required Methods§
Sourcefn commands(&self) -> Vec<CommandInfo>
fn commands(&self) -> Vec<CommandInfo>
The commands for the menu and /help (the shell adds its built-ins after them).
Sourcefn run(&mut self, line: &str, ctx: &mut Ctx<'_, Self>)
fn run(&mut self, line: &str, ctx: &mut Ctx<'_, Self>)
A line the user sent that isn’t a built-in. Long work goes on a worker
thread with Ctx::start; output goes through crate::out.
Provided Methods§
Sourcefn panel_event(
&mut self,
event: <Self::Panel as Panel>::Event,
ctx: &mut Ctx<'_, Self>,
)
fn panel_event( &mut self, event: <Self::Panel as Panel>::Event, ctx: &mut Ctx<'_, Self>, )
The open panel asked for something.
Sourcefn tick(&mut self, ctx: &mut Ctx<'_, Self>)
fn tick(&mut self, ctx: &mut Ctx<'_, Self>)
Every tick (about 80 ms): background checks, timers.
Sourcefn refresh(&mut self)
fn refresh(&mut self)
After a command or a settings change: re-read what may have changed. The shell reads the header, notices, footer and placeholder again after.
Sourcefn notices(&self) -> Vec<Notice>
fn notices(&self) -> Vec<Notice>
Messages for the right of the status bar, most important first.
Under the input box.
Sourcefn placeholder(&self) -> String
fn placeholder(&self) -> String
In the empty input box.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".