Skip to main content

Signature

Trait functions

expect

Returns the contained Ok value, consuming the self value.

Panics

Panics if the value is an Err, with the provided felt252 panic message.

Examples

Signature

unwrap

Returns the contained Ok value, consuming the self value.

Panics

Panics if the value is an Err, with a standard Result::unwrap failed panic message.

Examples

Signature

unwrap_or

Returns the contained Ok value or a provided default.

Signature

Examples

unwrap_or_default

Returns the contained Ok value or Default::::default().

Signature

Examples

unwrap_or_else

Returns the contained Ok value or computes it from a closure.

Signature

Examples

and

Returns other if the result is Ok, otherwise returns the Err value of self.

Signature

Examples

and_then

Calls op if the result is Ok, otherwise returns the Err value of self. This function can be used for control flow based on Result values.

Signature

Examples

or

Returns other if the result is Err, otherwise returns the Ok value of self.

Signature

Examples

or_else

Calls op if the result is Err, otherwise returns the Ok value of self. This function can be used for control flow based on result values.

Signature

Examples

expect_err

Returns the contained Err value, consuming the self value.

Panics

Panics if the value is an Ok, with the provided felt252 panic message.

Examples

Signature

unwrap_err

Returns the contained Err value, consuming the self value.

Panics

Panics if the value is an Ok, with a standard Result::unwrap_err failed. panic message.

Examples

Signature

is_ok

Returns true if the Result is Ok.

Signature

Examples

is_err

Returns true if the Result is Err.

Signature

Examples

into_is_ok

Returns true if the Result is Ok, and consumes the value.

Signature

Examples

into_is_err

Returns true if the Result is Err, and consumes the value.

Signature

Examples

ok

Converts from Result to Option. Converts self into an Option, consuming self, and discarding the error, if any.

Signature

Examples

err

Converts from Result to Option. Converts self into an Option, consuming self, and discarding the success value, if any.

Signature

Examples

map

Maps a Result to Result by applying a function to a contained Ok value, leaving an Err value untouched. This function can be used to compose the results of two functions.

Signature

Examples

Print the square of the number contained in the Result, otherwise print the error.

map_or

Returns the provided default (if Err), or applies a function to the contained value (if Ok).

Signature

Examples

map_or_else

Maps a Result to U by applying fallback function default to a contained Err value, or function f to a contained Ok value. This function can be used to unpack a successful result while handling an error.

Signature

Examples

map_err

Maps a Result to Result by applying a function to a contained Err value, leaving an Ok value untouched. This function can be used to pass through a successful result while handling an error.

Signature

Examples