started using ratatui
This commit is contained in:
29
src/app.rs
Normal file
29
src/app.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use sqlite::Connection;
|
||||
|
||||
pub enum CurrentScreen {
|
||||
Main,
|
||||
Exiting,
|
||||
}
|
||||
|
||||
pub struct App {
|
||||
pub current_screen: CurrentScreen,
|
||||
connection: Connection,
|
||||
exit: bool,
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub fn new() -> App {
|
||||
let connection = match Connection::open("ft_rs.db") {
|
||||
Ok(con) => con,
|
||||
Err(e) => {
|
||||
eprintln!("Error opening database: {}", e);
|
||||
panic!("stopping");
|
||||
}
|
||||
};
|
||||
return App {
|
||||
current_screen: CurrentScreen::Main,
|
||||
connection: connection,
|
||||
exit: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user