Struct rlifesrc::tui::App

source ·
struct App<'a, W: Write> {
    gen: i32,
    period: i32,
    world: PolyWorld,
    status: Status,
    paused: bool,
    start_time: Option<Instant>,
    timing: Duration,
    reset: bool,
    output: &'a mut W,
    term_size: (u16, u16),
    world_size: (i32, i32),
    mode: Mode,
}

Fields§

§gen: i32§period: i32§world: PolyWorld§status: Status§paused: bool§start_time: Option<Instant>§timing: Duration§reset: bool§output: &'a mut W§term_size: (u16, u16)§world_size: (i32, i32)§mode: Mode

Implementations§

source§

impl<'a, W: Write> App<'a, W>

source

fn new(world: PolyWorld, reset: bool, output: &'a mut W) -> Result<Self>

source

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

Initializes the screen.

source

fn quit(&mut self) -> Result<()>

Quits the program.

source

fn update_header(&mut self) -> Result<()>

Updates the header.

source

fn update_main(&mut self) -> Result<()>

Updates the main part of the screen. Prints the pattern in a mix of Plaintext and RLE format.

Updates the footer.

source

fn update(&mut self) -> Result<()>

Updates the screen.

source

fn pause(&mut self)

Pauses.

source

fn start(&mut self)

Starts or resumes.

source

fn step(&mut self)

Searches for one step.

source

fn ask_quit(&mut self) -> Result<()>

Asks whether to quit.

source

fn handle(&mut self, event: Option<Event>) -> Result<bool>

Handles a key event. Returns true to quit the program.

source

async fn main_loop(&mut self, reader: &mut EventStream) -> Result<()>

The main loop.

Trait Implementations§

source§

impl<W: Write> Drop for App<'_, W>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, W> !RefUnwindSafe for App<'a, W>

§

impl<'a, W> !Send for App<'a, W>

§

impl<'a, W> !Sync for App<'a, W>

§

impl<'a, W> Unpin for App<'a, W>

§

impl<'a, W> !UnwindSafe for App<'a, W>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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 Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V