Trait Process

Source
pub trait Process {
    // Required methods
    fn min_height(&self) -> usize;
    fn render<B: Backend>(&mut self, frame: &mut Frame<'_, B>, area: Rect);
    fn process_raw_event(
        &mut self,
        event: Event,
    ) -> Result<Option<ProcessOutput>>;

    // Provided methods
    fn peek(&mut self) -> Result<Option<ProcessOutput>> { ... }
    fn show<B, F>(
        self,
        terminal: &mut Terminal<B>,
        area: F,
    ) -> Result<ProcessOutput>
       where B: Backend,
             F: FnMut(&Frame<'_, B>) -> Rect,
             Self: Sized { ... }
}
Expand description

Trait to display a process on the shell

Required Methods§

Source

fn min_height(&self) -> usize

Minimum height needed to render the process

Source

fn render<B: Backend>(&mut self, frame: &mut Frame<'_, B>, area: Rect)

Render self in the given area from the frame

Source

fn process_raw_event(&mut self, event: Event) -> Result<Option<ProcessOutput>>

Process raw user input event and return Some to end user interaction or None to keep waiting for user input

Provided Methods§

Source

fn peek(&mut self) -> Result<Option<ProcessOutput>>

Peeks into the result to check wether the UI should be shown (None) or we can give a straight result (Some)

Source

fn show<B, F>( self, terminal: &mut Terminal<B>, area: F, ) -> Result<ProcessOutput>
where B: Backend, F: FnMut(&Frame<'_, B>) -> Rect, Self: Sized,

Run this process render and process_event until we’ve got an output

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§