Result

Result: Ok, Err

Functions: unwrap, print

enum Result<T, E>

The result of an operation that can fail: either success (Ok) holding the produced value, or failure (Err) holding the error.

Ok

Ok(T value),

Err

Err(E error),

unwrap

T unwrap<T, E: Printable>(Result<T, E>& result)

Returns the success value, aborting with the error if the result is Err.

print

void print<T: Printable, E: Printable>(Result<T, E>& result)

Prints the given result.