Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Result enum

The Result enum

pub enum Result<T, E> {
    Ok(T),
    Err(E),
}

TODO: show the constructor example without lifetimes TODO: Show ordering of simple enums and enums that can have different variants TODO: show enum where one of the variants have more than one values or a value which is complex (e.g. tuple or struct)