Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result[T any] struct { // contains filtered or unexported fields }
Result represents failure or success. The Ok variant represents success and contains a value. The Err variant represent a failure and contains an error.
func (Result[T]) Unwrap ¶
func (r Result[T]) Unwrap() T
Unwrap returns the underlying value of an Ok variant, or panics if called on an Err variant.
func (Result[T]) UnwrapOr ¶
func (r Result[T]) UnwrapOr(value T) T
UnwrapOr returns the underlying value of an Ok variant, or the provided value on an Err variant.
func (Result[T]) UnwrapOrElse ¶
func (r Result[T]) UnwrapOrElse(f func() T) T
UnwrapOrElse returns the underlying value of an Ok variant, or the result of calling the provided function on an Err variant.
func (Result[T]) UnwrapOrZero ¶
func (r Result[T]) UnwrapOrZero() T
UnwrapOrZero returns the underlying value of an Ok variant, or the zero value of an Err variant.
Click to show internal directories.
Click to hide internal directories.