Beginning Rust Programming

Оглавление⌄
TITLE PAGE....10 INTRODUCTION....11 OBTAINING RUST....12 GETTING THE SOURCE CODE....14 WHAT YOU WILL LEARN....14 PROVIDING FEEDBACK....19 1 Game of Life: The Basics....20 GAME OF LIFE: THE PROGRAM....21 STARTING WITH CARGO....23 PUTTING THE PIECES TOGETHER....25 GENERATING THE GAME GRID....29 DISSECTING MAIN....30 LOOKING AT MORE FUNCTION FUNCTIONS....43 COMPILING PROGRAMS....53 SUMMARY....56 ADDITIONAL RESOURCES....58 2 Extended Life....60 UNDERSTANDING OWNERSHIP....61 EXTENDING LIFE....64 READING FROM FILES....78 OUTPUTTING TO THE TERMINAL....85 SUMMARY....90 ADDITIONAL RESOURCES....92 3 Building a Library....94 REFERENCES....95 FIRST PASS....100 SECOND PASS....116 SUMMARY....125 ADDITIONAL RESOURCES....127 4 Hangman....128 OUR DATA....133 READING FILES AND SELECTING WORDS....148 THE REST OF THE STORY....157 SUMMARY....164 ADDITIONAL RESOURCES....166 5 In Concurrence....167 THE DINING PHILOSOPHERS....169 THE MAIN EVENT....180 THREADING IN THE MAIN....191 SUMMARY....198 ADDITIONAL RESOURCES....200 6 Clients and Servers....201 PLANNING....203 NETWORK PROGRAMMING....206 RUST TCP SERVER....218 SUMMARY....230 ADDITIONAL RESOURCES....232 7 Client-Side Applications....233 ENCRYPTION....235 REMOTE ACCESS CLIENT....255 SUMMARY....269 ADDITIONAL RESOURCES....271 8 Going Relational....273 APPLICATION ARCHITECTURES....274 DATABASES....283 WRITING A DATABASE PROGRAM....292 SUMMARY....311 ADDITIONAL RESOURCES....314 9 No(SQL) Going....315 ASSERTIONS....316 NOSQL....328 WORKING WITH MONGODB....334 SUMMARY....352 ADDITIONAL RESOURCES....354 10 Web Communications....355 STYLE GUIDES....356 HYPERTEXT TRANSFER PROTOCOL....360 CLIENT COMMUNICATION....378 SUMMARY....391 ADDITIONAL RESOURCES....393 11 Web Server....394 OFFENSIVE VS. DEFENSIVE PROGRAMMING....395 WEB APPLICATION COMMUNICATIONS....399 RUST ROCKET....417 SUMMARY....426 ADDITIONAL RESOURCES....428 12 Getting to the System....430 EXTENDING FUNCTIONALITY....432 WINDOWS REGISTRY....441 SYSTEM INFORMATION WITH RUST....458 PERSISTENCE (FOR FUN)....467 SUMMARY....469 ADDITIONAL RESOURCES....472 13 Device Programming....474 LOGGING....475 WORKING WITH RASPBERRY PI....497 SUMMARY....519 ADDITIONAL RESOURCES....521 14 Collecting Stuff....523 ARRAYS AND VECTORS....524 LINKED LISTS....536 SEARCH TREES....559 SUMMARY....567 ADDITIONAL RESOURCES....569 15 Odds and Sods....571 UNIT TESTING....572 RECURSION....591 MACHINE LEARNING....598 SUMMARY....610 ADDITIONAL RESOURCES....612 INDEX....613 COPYRIGHT....659 ABOUT THE AUTHOR....660 ABOUT THE TECHNICAL EDITOR....661 ACKNOWLEDGMENTS....662 END USER LICENSE AGREEMENT....663
Описание
В этом материале разберём тему: rust.
Don’t make me have to skim or skip through a half dozen chapters before I can get to something that’s going to be useful to me. Save me from another “hello, world” book. Or you, in this case. Instead of a dry explanation of how the language is constructed so you can try to put it all together in meaningful ways yourself, the purpose of this book is to jump straight into writing hopefully interesting or useful programs. I can’t tell you the number of programming books I’ve purchased over the decades, hoping to actually learn the language, only to end up just not using the book because it wasn’t presented in a way that made a lot of sense to me. Once we have the program, we can take a look at how it’s constructed. I hope you’ll find this a more useful and practical way of learning Rust. You’ll be learning by doing—or learning by example, if you prefer.
Like so many other languages, it claims a C-like syntax, which is roughly correct but misses out on many important elements. Rust is an interesting language, as it turns out. Where Rust really shines is where C has introduced bad behavior in programming practices. Where C provides you with the gun and the bullets to shoot yourself in the foot, Rust provides you with necessary protections to keep you from injuring yourself or, from the perspective of the application, keeps the application from crashing. This is more apparent as more have been using C as a language. Rust is focused on protecting the memory space of the program, in part to provide a better ability for concurrent programming. After all, Rust is considered to be a systems programming language, meaning it is intended for applications that are lower level than those that a user directly interacts with.
There are a lot of third-party libraries. In addition to protections provided to the programmer, Rust has a reasonably active community that can be used not only for support but also to get additional functionality for your programs. These libraries can make your life easier by introducing you to functionality without you needing to write it yourself.
You need all the surround to fully understand what is happening in the program. The idea behind this book is to introduce you to Rust in context, rather than via snippets that, by themselves, don’t work. You’ll find this out when you are looking at example code sometimes. This book doesn’t take that approach. This is true with the Rust documentation: it’s like you need to fully understand the language to understand the examples you are looking at. It assumes that you don’t know the language, so every line in every program is explained in as much detail as is necessary to pull it all apart, since Rust can be a dense language in some ways. This means single lines can pack a lot of meaning and functionality.
You will see examples for the programs written in Rust also presented in other programming languages. The one thing this book does not assume, though, is that you are coming to programming completely fresh. This may be helpful if you come from another language like C or Python, for instance, but want to learn Rust. If you don’t know those other languages, you can skip through those examples and jump to the explanation of how to write a program for the problem under discussion in Rust. Seeing the approach in a language you know before translating it into Rust may be beneficial. You can still compare the other languages to Rust as you are going through so you can better understand Rust and how it is different from other languages.
На этом основные моменты по теме закрыты.
Поделиться
Частые вопросы
Можно ли скачать «Beginning Rust Programming» бесплатно?
Да, «Beginning Rust Programming» доступна для бесплатного скачивания на нашем сайте в формате PDF. Ссылка на файл находится на этой странице.
В каком формате и какого размера файл?
Книга предоставляется в формате PDF, размер файла 3,7 МБ.
Кто автор и когда вышла книга?
автор — Messier Ric, издательство John Wiley & Sons, Inc., год выпуска 2021, 663 страниц.
О чём книга «Beginning Rust Programming»?
Save me from another “hello, world” book.