Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying The Rust Programming Handbook
  • Table Of Contents Toc
The Rust Programming Handbook

The Rust Programming Handbook

By : Francesco Ciulla
1 (2)
close
close
The Rust Programming Handbook

The Rust Programming Handbook

1 (2)
By: Francesco Ciulla

Overview of this book

The Rust Programming Handbook is a deeply engaging and meticulously crafted book designed to immerse programmers into the intricate world of Rust’s core principles and sophisticated features. This book not only enhances your coding skills but also prepares you to tackle complex challenges in software development, optimizing your code for better performance and reliability. You will explore Rust’s powerful concurrency models, rigorous memory safety guarantees, and its versatile trait system. Discover the foundational elements that make Rust a standout language for developing safe and efficient applications. The book will show you how these core principles can seamlessly transition into real-world applications. You will learn how to apply Rust's capabilities to systems programming and web development, extending the reach of its safety and efficiency benefits across different programming domains. Whether it's creating low-level system components or high-performance web services, the book provides practical examples to integrate Rust effectively into a variety of projects. Elevate your coding skills and become a sought-after professional in the tech industry with this essential guide. Rust from Beginner to Professional is your definitive toolkit for mastering advanced Rust programming techniques and writing high-quality code.
Table of Contents (20 chapters)
close
close
18
Other Books You May Enjoy
19
Index

Adding persistence with PostgreSQL

Storing data in an in-memory Arc<Mutex<Vec<Todo>>> is great for examples, but it has a major drawback: all our data is lost when the server restarts.

For a real application, we need persistence.

This means storing our data in a database. In this section, we’ll refactor our API to use PostgreSQL, a powerful and popular open source relational database.

We’ll use sqlx, a modern, pure-Rust, and async-native SQL toolkit.

Database setup

Before our Rust app can connect with a database, it’s important to have a database server up and running.

Although you can install PostgreSQL directly on your computer, using Docker to run it inside a container is a much cleaner, more straightforward, and more consistent approach for development.

This method keeps the database isolated, avoids any conflicts, and makes cleanup a breeze. Just stop the container when you’re done.

If you haven’...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
The Rust Programming Handbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon