Glossary coding Term Page

Option

A Rust enum that forces missing values to be handled explicitly

option #rust#enum#null-safety
Korean version

Aliases

Option<T>maybe value

Prerequisites

Related Concepts

Core Idea

Option is Rust's standard enum for expressing whether a value exists as Some(T) or is absent as None. Instead of allowing a hidden null, Rust makes the missing-value case part of the type system.

Why It Matters Here

Mathbong uses Option across optional struct fields, borrowed return values, and match-based branching. It is the basic tool for saying "this value may be missing" without losing safety.

Posts Mentioning This Concept