MCPcopy Create free account
hub / github.com/Autoparallel/learner / new

Method new

crates/learnerd/src/tui/mod.rs:60–72  ·  view source on GitHub ↗

Creates a new TUI instance

(mut learner: Learner)

Source from the content-addressed store, hash-verified

58impl Tui {
59 /// Creates a new TUI instance
60 pub async fn new(mut learner: Learner) -> Result<Self> {
61 // Get initial paper list
62 let papers =
63 Query::list_all().order_by(OrderField::Title).execute(&mut learner.database).await?;
64
65 // Setup terminal
66 enable_raw_mode()?;
67 let mut stdout = io::stdout();
68 execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
69 let terminal = Terminal::new(CrosstermBackend::new(stdout))?;
70
71 Ok(Self { terminal, state: UIState::new(papers), learner })
72 }
73
74 /// Runs the TUI main loop
75 pub async fn run(&mut self) -> Result<()> {

Callers

nothing calls this directly

Calls 2

order_byMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected