Struct App

Source
pub struct App { /* private fields */ }
Expand description

A base App object which ‘owns’ the terminal, manages logging etc.

Implementations§

Source§

impl App

Source

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()?;
Source

pub fn init(&mut self) -> Result<()>

Initialize the terminal, place it into ‘cooked’ mode and install panic handler.

let app = with_writer().init()?;
Source

pub fn toggle_log_output(&self) -> Result<()>

Toggles debug output

Source

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.

Source

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§

Source§

impl Drop for App

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> UnsafeAny for T
where T: Any,