std-module

std::result — recoverable failures

This module contains Result and related iterator types. Use it when an operation may fail and a caller needs failure information. The compiler normally warns about unused Results; handle them deliberately. Expected stdout (not executed): true Common mistake: Dropping a returned Result without deciding how failure should be handled.

Formal Syntax & Structure

rust syntaxrust
use std::result::Result;

Working Example

Example Snippetrust
fn main() {    let value: Result<u32, _> = "18".parse();    println!("{}", value.is_ok());}
Rust Reference