Command-Line Rust

A Project-Based Primer for Writing Rust CLIs

Ken Youens-Clark ,

 
Tap to preview
Command-Line Rust: A Project-Based Primer for Writing Rust CLIs

About the eBook

Updated in 2024: A new version has been released that simplifies the programs used in the book, based on changes in the Rust language and crates since original publication. The code has been updated to reflect version 4 of the clap crate.



For several consecutive years, Rust has been voted "most loved programming language" in Stack Overflow's annual developer survey. This open source systems programming language is now used for everything from game engines and operating systems to browser components and virtual reality simulation engines. But Rust is also an incredibly complex language with a notoriously difficult learning curve.

Rather than focusing on the language as a whole, this guide teaches Rust using a single small, complete, focused program in each chapter. Author Ken Youens-Clark shows you how to start, write, and test each of these programs to create a finished product. You'll learn how to handle errors in Rust, read and write files, and use regular expressions, Rust types, structs, and more.

Discover how to:

Use Rust's standard libraries and data types such as numbers, strings, vectors, structs, Options, and Results to create command-line programsWrite and test Rust programs and functionsRead and write files, including stdin, stdout, and stderrDocument and validate command-line argumentsWrite programs that fail gracefullyParse raw and delimited text manually, using regular expressions and Rust cratesUse and control randomness
Show more



In The Press


About the Author


  • Publisher:
  • Published: ; Copyright:
  • ISBN:
  • Edition:
  • Title:
  • Series:
  • Author:
  • Imprint:
  • Language:
  • Number of Pages:  [disclaimer] Page count shown is an approximation provided by the publisher. The actual page count will vary based on various factors such your device's screen size and font-size.

Read online

You can read this ebook online in a web browser, without downloading anything or installing software.

Download file formats

This ebook is available in file types:

This ebook is available in:

After you've bought this ebook, you can choose to download either the PDF version or the ePub, or both.

DRM Free

The publisher has supplied this book in DRM Free form with digital watermarking.

Required software

You can read this eBook on any device that supports DRM-free EPUB or DRM-free PDF format.

Digital Rights Management (DRM)

The publisher has supplied this book in encrypted form, which means that you need to install free software in order to unlock and read it.

Required software

To read this ebook on a mobile device (phone or tablet) you'll need to install one of these free apps:

To download and read this eBook on a PC or Mac:

  • Adobe Digital Editions (This is a free app specially developed for eBooks. It's not the same as Adobe Reader, which you probably already have on your computer.)

Limits on printing and copying

The publisher has set limits on how much of this ebook you may print or copy. See details.

  • {{ format_drm_information.format_name }} unrestricted {{ format_drm_information.format_name }} {{format_drm_information.page_percent}}% pages every day{{format_drm_information.interval}} days {{ format_drm_information.format_name }} off
Read Aloud
  • {{ read_aloud_information.format_name }} on {{ read_aloud_information.format_name }} off
Categories
  •  > 
ISBNs