Code Monkey home page Code Monkey logo

rust-essentials-second-edition's Introduction

Rust Essentials - Second Edition

This is the code repository for Rust Essentials - Second Edition, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

About the Book

Rust is the programming language for the 21st century, developed at Mozilla Research, and with a steadily growing community. It was created to solve the dilemma between high-level, slow code with minimal control over the system, and low-level, fast code with maximum system control. This book will give you a head start to solve systems programming and application tasks with Rust.

We start off with an argumentation of Rust's unique place in today's landscape of programming languages. You'll install Rust and learn how to work with its package manager Cargo. The various concepts are introduced step by step: variables, types, functions, and control structures to lay the groundwork. Then we explore more structured data such as strings, arrays, and enums, and you’ll see how pattern matching works.

Next we look at Rust's specific way of error handling, and the overall importance of traits in Rust code. The pillar of memory safety is treated in depth. Next, you’ll see how macros can simplify code generation, and how to compose bigger projects with modules and crates. Finally, you’ll discover how we can write safe concurrent code in Rust and interface with C programs, get a view of the Rust ecosystem, and explore the use of the standard library.

Instructions and Navigation

All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.

The code will look like the following:

static MAX_HEALTH: i32 = 100; 
static GAME_NAME: &str = "Monster Attack"; 
const MYPI: f32 = 3.14; 
 
fn main() { 
  println!("The Game you are playing is called {}.", GAME_NAME); 
  println!("You start with {} health points.", MAX_HEALTH); 
}

To run the code examples in the book, you will need the Rust system for your computer, which can be downloaded from http://www.rust-lang.org/install.html.

This also contains the Cargo project and package manager. To work more comfortably with Rust code, a development environment like Sublime Text can also be of use. Chapter 1, Starting with Rust, contains detailed instructions on how to set up your Rust environment.

Related Products

rust-essentials-second-edition's People

Contributors

ruvikarao avatar dominicpereira92 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.