Step Into Labs

Step Into Rust · Lesson 13 · Systems Rust

Safe Wrappers for Win32

UTF-16 the std way, errors as Result with real messages, and handles that close themselves.

Part of Step Into Rust. The full lesson, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.

In the Windows API lesson you called extern "system" functions directly. Real Rust code wraps each one once, so the rest of the program never touches a raw handle or an error code:

In this lesson

Missions

  1. UTF-16 the std way
  2. Errors that explain themselves
  3. A handle that closes itself
  4. Result all the way down