Rust Error Handling

survey of error handling

Contents:

Demos for Rust error handling: Rust has a rich set of error handling operations built into the language. This repository contains demonstration code for those operations.
  1. RustPanics
    demonstrates when panics occur and how to trap them
  2. ErrorHandlingOps
    demonstrates quering returned results with is_ok, match, let if, ?
  3. ConsoleErrorHandling
    handling errors with stdin and stdout
  4. FileErrorHandling
    handling file open and read/write errors
  5. IndexOutOfBounds
    demonstrates that Rust out of bounds index results in panic
  6. CppUndefinedBehavior
    Illustrates that C++ allows mutation of data with active references and indexing out of bounds, both resulting in undefined behavior. Also shows that C++ provides conventions to avoid undefined behavior.

Build:

This Rust code was built with Cargo from Visual Studio Code terminal and tested on Windows 10.

Status:

No planned changes.