pub struct App { /* private fields */ }
Expand description
A base App object which ‘owns’ the terminal, manages logging etc.
Implementations§
Source§impl App
impl App
Sourcepub fn with_writer(stdout: Stdout) -> Self
pub fn with_writer(stdout: Stdout) -> Self
Constructor for the App struct which takes in the output where to write the output of the program
let app = with_writer().init()?;
Sourcepub fn init(&mut self) -> Result<()>
pub fn init(&mut self) -> Result<()>
Initialize the terminal, place it into ‘cooked’ mode and install panic handler.
let app = with_writer().init()?;
Sourcepub fn toggle_log_output(&self) -> Result<()>
pub fn toggle_log_output(&self) -> Result<()>
Toggles debug output
Sourcepub fn keyboard_event(
&mut self,
form: &mut Form,
ev: Event,
) -> Result<EventResult>
pub fn keyboard_event( &mut self, form: &mut Form, ev: Event, ) -> Result<EventResult>
Process keyboard input, returning an EventResult indicating wheter the user submittied, aobrted, toggled debug output or if further input is required.
Sourcepub fn execute(&mut self, form: &mut Form) -> Result<EventResult>
pub fn execute(&mut self, form: &mut Form) -> Result<EventResult>
Executes a form to completion. This is the event loop of a program under normal conditions. Uses the crossterm input events.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for App
impl !RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl !UnwindSafe for App
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more