[][src]Trait iced_pancurses::Sandbox

pub trait Sandbox: Sized {
    type Message: Debug + Send + Clone + 'static;
    fn new() -> Self;
fn update(&mut self, messages: Vec<Self::Message>);
fn view(&mut self) -> Element<Self::Message, PancursesRenderer>; fn run() { ... } }

Associated Types

type Message: Debug + Send + Clone + 'static

Loading content...

Required methods

fn new() -> Self

Initializes the Sanbox

Should return the initial state of the sandbox

fn update(&mut self, messages: Vec<Self::Message>)

Handles the dispatch of a message and updates the state of the sandbox

This function should define the update logic. All messages produced by user interaction will be handled here.

fn view(&mut self) -> Element<Self::Message, PancursesRenderer>

Request drawing the new state of the UI

Returns the root element to display using the renderer

Loading content...

Provided methods

fn run()

Launches the sandbox and takes ownership of the current thread.

This should be the last thing you execute at the end of the entrypoint of your program.

Loading content...

Implementors

Loading content...