Rust Cookbook
Book information
Description
Contents......Page 3 Preface......Page 14 Introduction......Page 20 Setting up Rust in Linux and macOS......Page 21 Creating your first Rust program......Page 26 Defining a variable assignment......Page 28 Setting up Boolean and the character types......Page 30 Controlling decimal points, number formats, and named arguments......Page 32 Performing arithmetic operations......Page 33 Defining mutable variables......Page 35 Declaring and performing string operations......Page 36 Declaring arrays and using slices in Rust......Page 41 Declaring vectors in Rust......Page 42 Declaring tuples in Rust......Page 44 Performing calculations on two numbers......Page 45 Introduction......Page 48 Defining an expression......Page 49 Defining constants......Page 50 Performing variable bindings......Page 52 Performing type casting in Rust......Page 54 Decision-making with Rust......Page 57 Looping operations in Rust......Page 59 Defining the enum type......Page 62 Defining closures......Page 65 Performing pointer operations in Rust......Page 66 Defining your first user-defined data type......Page 68 Adding functionality to the user-defined data type......Page 71 Similar functionality for different data type......Page 73 Creating a new project using Cargo......Page 76 Downloading an external crate from crates.io......Page 81 Working on existing Cargo projects......Page 85 Running tests with Cargo......Page 88 Configuration management of the project......Page 89 Building the project on the Travis CI......Page 92 Uploading to crates.io......Page 95 Defining a module in Rust......Page 98 Building a nested module......Page 102 Creating a module with struct......Page 105 Controlling modules......Page 110 Accessing modules......Page 112 Creating a file hierarchy......Page 116 Building libraries in Rust......Page 122 Calling external crates......Page 124 Introduction......Page 126 Creating a thread in Rust......Page 127 Spawning multiple threads......Page 128 Holding threads in a vector......Page 131 Sharing data between threads using channels......Page 134 Implementing safe mutable access......Page 137 Creating child processes......Page 140 Waiting for a child process......Page 142 Making sequential code parallel......Page 144 Introduction......Page 149 Implementing panic......Page 150 Implementing Option......Page 151 Creating map combinator......Page 155 Creating and_then combinator......Page 158 Creating map for the Result type......Page 161 Implementing aliases......Page 164 Handling multiple errors......Page 166 Implementing early returns......Page 169 Implementing the try! macro......Page 171 Defining your own error types......Page 173 Implementing the boxing of errors......Page 177 Macros......Page 182 Building macros in Rust......Page 183 Implementing matching in macros......Page 184 Playing with common Rust macros......Page 186 Implementing designators......Page 188 Overloading macros......Page 190 Implementing repeat......Page 192 Implementing DRY......Page 194 Introduction......Page 199 Calling C operations from Rust......Page 200 Calling Rust commands from C......Page 203 Calling Rust operations from Node.js apps......Page 207 Calling Rust operations from Python......Page 211 Writing a Python module in Rust......Page 214 Introduction......Page 219 Setting up a web server......Page 220 Creating endpoints......Page 224 Handling JSONRequests......Page 228 Building custom error handlers......Page 232 Hosting templates......Page 236 Setting up the API......Page 241 Saving user data in MongoDB......Page 247 Fetching user data......Page 254 Deleting user data......Page 261 Advanced Rust Tools & Libraries......Page 269 Setting up rustup......Page 270 Setting up rustfmt......Page 273 Setting up rust-clippy......Page 277 Setting up and testing with Servo......Page 282 Generating random numbers......Page 283 Writing lines to a file......Page 285 Parsing unstructured JSON......Page 288 Parsing URL from a string......Page 291 Decompressing a tarball......Page 294 Compressing a directory to a tarball......Page 297 Finding file extensions recursively......Page 299 Index......Page 303
Similar books
Rust Cookbook
2017 · EPUB
Rust Cookbook
2017 · AZW3
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF