chore: prepares for stage3/step1

This commit is contained in:
itsscb 2024-08-12 15:17:21 +02:00
parent ed37b8ccc8
commit 5411e39548
2 changed files with 12 additions and 0 deletions
src

@ -1,6 +1,7 @@
mod db;
mod io_utils;
mod models;
mod navigator;
mod ui;
fn main() {

@ -1,3 +1,4 @@
use std::any::Any;
use std::rc::Rc;
use anyhow::anyhow;
@ -13,6 +14,7 @@ use page_helpers::*;
pub trait Page {
fn draw_page(&self) -> Result<()>;
fn handle_input(&self, input: &str) -> Result<Option<Action>>;
fn as_any(&self) -> &dyn Any;
}
pub struct HomePage {
@ -52,6 +54,9 @@ impl Page for HomePage {
),
}
}
fn as_any(&self) -> &dyn Any {
self
}
}
pub struct EpicDetail {
@ -126,6 +131,9 @@ impl Page for EpicDetail {
),
}
}
fn as_any(&self) -> &dyn Any {
self
}
}
pub struct StoryDetail {
@ -174,6 +182,9 @@ impl Page for StoryDetail {
_ => Ok(None),
}
}
fn as_any(&self) -> &dyn Any {
self
}
}
#[cfg(test)]