liveBook · Manning

Safety

As explained in Rust Servers, Services, and Apps

The property of software or a programming language preventing classes of invalid or hazardous behavior.

Program safety is a benefit of Rust for application backends and software infrastructure. It has three aspects: type safety, memory safety, and thread safety. section 1.2.2

Rust’s compile-time type checking enforces type constraints:

  • The compiler infers unspecified types where possible and reports conflicts or cases it cannot resolve, helping eliminate a class of runtime errors. section 1.2.2
  • Memory safety is identified as a distinctive aspect of Rust, with its detailed analysis deferred. section 1.2.2
  • Thread safety is named as a third aspect, but its treatment is not detailed here. section 1.2.2

How Rust Servers, Services, and Apps covers it

How deep it goes
Distinguishes three safety aspects and explains compile-time type checking, while deferring detailed memory-safety analysis.
Examples
Contrasts manual memory management in C and C++ with garbage-collected languages including Java, C#, Python, Ruby, and Go.
What you can do after
Understand how compile-time type checking helps prevent a class of runtime errors.
How it connects
Connects type safety with static typing and compile-time checking, and names memory safety and thread safety.

Also explained in

Compare how 8 books explain safety →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.