Submodules
Constants
Procedures
and

Returns other if result contains a value and otherwise returns result.

Arguments

result - ( #err any | #ok any )

other - ( #err any | #ok any )

Returns

( #err any | #ok any )

and_then

Returns the result of calling f with the value contained by result or simply returns result if it contain an error. This differs from std::res::map in that for this procedure, f needs to return a result instead of the new contained value.

Arguments

result - ( #err any | #ok any )

f - |any| -> ( #err any | #ok any )

Returns

( #err any | #ok any )

expect

Returns the value contained by result. This procedure shall be used if there is good reason to assume that result will always contain a value, and the reasoning for this shall be passed for reason. If result does not contain a value, the a panic with the given message reason will be triggered.

Arguments

result - ( #err any | #ok any )

reason - str

Returns

any

expect_err

Returns the error contained by result. This procedure shall be used if there is good reason to assume that result will always contain an error, and the reasoning for this shall be passed for reason. If result does not contain an error, the a panic with the given message reason will be triggered.

Arguments

result - ( #err any | #ok any )

reason - str

Returns

any

get_err

Returns the error contained by result.

Arguments

result - ( #err any | #ok any )

Returns

( #some any | #none unit | ... )

get_ok

Returns the value contained by result.

Arguments

result - ( #err any | #ok any )

Returns

( #some any | #none unit | ... )

is_err

Returns true if result contains an error.

Arguments

result - ( #err any | #ok any )

Returns

bool

is_ok

Returns true if result contains a value.

Arguments

result - ( #err any | #ok any )

Returns

bool

iter

Returns an iterator that returns the value contained by result once. If result contains an error, an empty iterator is returned.

Arguments

result - ( #err any | #ok any )

Returns

|| -> ( #next any | #end unit | ... )

iter_err

Returns an iterator that returns the error contained by result once. If result contains a value, an empty iterator is returned.

Arguments

result - ( #err any | #ok any )

Returns

|| -> ( #next any | #end unit | ... )

map

Returns a new result value by passing the value possibly contained by result to mapping.

Arguments

result - ( #err any | #ok any )

mapping - |any| -> any

Returns

( #err ( #err any | #ok any ) | #ok any | ... )

map_err

Returns a new result value by passing the error possibly contained by result to mapping.

Arguments

result - ( #err any | #ok any )

mapping - |any| -> any

Returns

( #err any | #ok ( #err any | #ok any ) | ... )

or

Returns result if result contains a value and otherwise returns other.

Arguments

result - ( #err any | #ok any )

other - ( #err any | #ok any )

Returns

( #err any | #ok any )

or_else

Returns the result of calling f with the error contained by result or simply returns result if it contain a value. This differs from std::res::map_err in that for this procedure, f needs to return a result instead of the new contained error.

Arguments

result - ( #err any | #ok any )

f - |any| -> ( #err any | #ok any )

Returns

( #err any | #ok any )

unwrap_err_or

Returns either the error contained by result or default if it contains a value.

Arguments

result - ( #err any | #ok any )

default - any

Returns

any

unwrap_err_or_else

Returns either the error contained by result or the result of calling f with the contained value.

Arguments

result - ( #err any | #ok any )

f - |any| -> any

Returns

any

unwrap_or

Returns either the value contained by result or default if it contains an error.

Arguments

result - ( #err any | #ok any )

default - any

Returns

any

unwrap_or_else

Returns either the value contained by result or the result of calling f with the contained error.

Arguments

result - ( #err any | #ok any )

f - |any| -> any

Returns

any