5

Getting started with Rust 🦀 2021: 7a. Building a GUI app in Rust [Part A]

 2 years ago
source link: https://www.youtube.com/watch?v=NtUkr_z7l84
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Getting started with Rust 🦀 2021: 7a. Building a GUI app in Rust [Part A]

2,435 views
Oct 10, 2021

In this episode, we'll build a GUI app in Rust (`headlines`) to make use of the newsapi crate we built before.

Part A of this episode, is where we plan our UI, data model and scaffold our frontend UI using an immediate mode GUI library.

Later in part B (the next video) we'll make this thing come to life by fetching data from newsapi.org. We'll learn about threads, channels and how to manage asynchronous data in the context of an immediate mode GUI library.

EP7 Part B of this video: https://www.youtube.com/watch?v=SvFPd...

This is in continuation of exploratory style videos that am making on Rust. We'll start a new series after this, where we'll start with the language from the very basics.

For context on newsapi crate watch the last 3 videos in the channel.

This video wouldn't have been possible without the amazing people in the Rust community building high quality libraries. So a big thanks!

Timecode: 0:00 - Intro

0:59 - Recon and wireframe 2:10 - Choosing a GUI library 2:55 - Immediate vs Retained mode APIs 6:09 - Implementation 9:22 - Rendering dummy list of articles 12:22 - Making articles scrollable 14:05 - Adding a custom font 17:25 - Making the news cards look good 19:55 - refactor and cleanups 20:58 - Adding header and footer widget 23:55 - Adding the top panel with controls 26:57 - Closing notes and towards part B

Target audience: Programmers who are new to Rust and want a bird's eye overview of the development experience in Rust.

Links:

Code repository (git tag: ep7a): https://github.com/creativcoder/headl...

Crates:

iced: https://github.com/iced-rs/iced egui: https://github.com/emilk/egui sixtyfps: https://github.com/sixtyfpsui/sixtyfps confy: https://github.com/rust-cli/confy tracing: https://github.com/tokio-rs/tracing serde: https://github.com/serde-rs/serde

Good to know:

Immediate vs retained mode API: https://docs.microsoft.com/en-us/wind... The elm architecture: https://guide.elm-lang.org/architecture/ ImGui: https://github.com/ocornut/imgui Cow type: https://doc.rust-lang.org/std/borrow/... cargo workspaces: https://doc.rust-lang.org/book/ch14-0... rust-analyzer: https://rust-analyzer.github.io/ Range type which implements Iterator trait: https://doc.rust-lang.org/std/ops/str... BTreeMap: https://doc.rust-lang.org/std/collect...

---------------------------------------------------------------- This series is aimed at programmers who already have some experience with at least one imperative language such as Python or C/C++, but are new to Rust.

What is Rust and why should you invest time in learning it?

Rust is the most loved programming language according to the Stack Overflow survey for 6th year in a row (2016-2021). Read more in the following blog: https://stackoverflow.blog/2020/06/05...

Thanks for watching!

This channel is dedicated in helping people become better at programming.

Social Platforms: 🐤 Twitter: https://twitter.com/creativcoder 📒 Github: https://github.com/creativcoder 📗 Polywork: https://www.polywork.com/creativcoder 🕸️ Blog: https://creativcoder.dev

Support:

Patreon: https://www.patreon.com/creativcoder Ko-fi: https://ko-fi.com/creativcoder

Your support is very much appreciated.

Free and open source software that I use: 🌐 Firefox: https://www.mozilla.org/en-US/exp/ 📽️ Open Broadcaster Software: https://obsproject.com 🎬 Kdenlive: https://kdenlive.org 🎨 GIMP: https://www.gimp.org/ 🔊 Audacity: https://www.audacityteam.org/ 🖌️ MyPaint: http://mypaint.org/

Have a great day :)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK