Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "core/option"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
mem |
core/mem |
option.dodo |
take
Function · Source
Move the payload out while leaving an empty option in its original place.
pub fn take<T>(value: &mut Option<T>) -> Option<T>
replace
Function · Source
pub fn replace<T>(value: &mut Option<T>, replacement: T) -> Option<T>
unwrap_or
Function · Source
pub fn unwrap_or<T>(value: Option<T>, fallback: T) -> T