Rust
The Ultimate Beginner's Guide to Learn Rust programming Step by Step
st edition
2020
By John Bach
"Programming isn't about what you know; it's about what you can figure out . - Chris Pine
.
Memlnc.com
WHY LEARN A NEW PROGRAMMING LANGUAGE?..............................................................12
WHERE RUST SHINES............................................................................................................13
SETTING UP...........................................................................................................................15
CHAPTER I ________________________________________________________________22
FIRST STEPS............................................................................................................................22
HELLO WORLD! .....................................................................................................................23
HELLO, CARGO! .....................................................................................................................27
MIGRATING IN CHARGE.........................................................................................................28
A NEW PROJECT.....................................................................................................................32
CHAPTER II ________________________________________________________________35
LEARN RUST............................................................................................................................35
INITIAL SETUP..........................................................................................................................35
PROCESSING A RIDDLE ATTEMPT............................................................................................37
GENERATING A SECRET NUMBER...........................................................................................45
COMPARING RIDDLES.............................................................................................................51
ITERATION...............................................................................................................................58
COMPLETED! ..........................................................................................................................68
RUST WITHIN OTHER LANGUAGES..........................................................................................90
THE PROBLEM.........................................................................................................................91
A RUST LIBRARY......................................................................................................................93
RUBY........................................................................................................................................97
PYTHON...................................................................................................................................99
NODE.JS.................................................................................................................................100
$ NPM INSTALL FFI................................................................................................................100
CHAPTER III______________________________________________________________102
RUST CASH..........................................................................................................................,102
THE STACK AND THE MOUND..............................................................................................103
MEMORY MANAGEMENT.....................................................................................................103
THE BATTERY........................................................................................................................103
THE MOUND.........................................................................................................................108
ARGUMENTS AND BORROWING...........................................................................................111
A COMPLEX EXAMPLE...........................................................................................................112
WHAT DO OTHER LANGUAGES DO? ....................................................................................118
WHICH TO USE......................................................................................................................119
EXECUTION TIME EFFICIENCY..............................................................................................119
SEMANTIC IMPACT...............................................................................................................119
TESTS...........................................................................................................,120
THE TEST ATTRIBUTE.............................................................................................................120
THE TESTS MODULE..............................................................................................................127
THE TESTS DIRECTORY...........................................................................................................129
DOCUMENTATION TESTS......................................................................................................131
[CFG (TEST)] ..........................................................................................................................131
CONDITIONAL COMPILATION................................................................................................133
CFG_ATTR..............................................................................................................................135
CFG! ......................................................................................................................................135
DOCUMENTATION................................................................................................................135
ABOUT RUSTDOC..................................................................................................................135
DOCUMENTING SOURCE CODE.............................................................................................136
WRITING DOCUMENTATION COMMENTS............................................................................137
SPECIAL SECTIONS.................................................................................................................138
FN FOO () {}...........................................................................................................139
FN FOO () {}...........................................................................................................139
FN FOO () {}...........................................................................................................140
FN FOO () {}...........................................................................................................140
FN FOO () {}...........................................................................................................141
FN FOO () {}...........................................................................................................141