Rust TUI Tutorial: Ratatui, Multithreading, and Responsiveness

Rust TUI Tutorial: Ratatui, Multithreading, and Responsiveness

7.914 Lượt nghe
Rust TUI Tutorial: Ratatui, Multithreading, and Responsiveness
#rustlang #tui #userinterface Ratatui is a popular Rust crate for building terminal user interfaces (TUIs). We explore how Ratatui interacts with the terminal, set up a simple user interface and take a deep dive into responsiveness. We'll opt for an efficient and modular design by implementing an event driven architecture for updating progress of a background computation as well as handling user input. Thanks to @littlesandra87 for hinting me at this great TUI crate, I had quite a bit of fun with it throughout the last few days :) I had a bit of a cold while recording the video, so my voice sounds a bit off at times. I hope you don't mind too much. GitHub repo for this video: https://github.com/Thodin/ratatui-background-process-example Timestamps: 00:00 TUIs are not a relic of the past 01:12 Our goal app for this video 01:40 Dependencies 02:00 Terminal backends 02:59 The Ratatui main loop 04:05 Terminal raw mode 04:54 The Ratatui main loop (continued) 06:27 Drawing to the terminal 08:13 Implementing the Widget trait 11:40 Handling user input 14:18 Adding a Progress bar 24:13 Background Processes 28:15 Implementing Event Driven Architecture 39:08 Wrap-Up