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