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 manages an option contained value, i.e. a value that may or may not be present.
func (Option[T]) Must ¶
func (o Option[T]) Must() T
Must return the value Option contains. If value is not present, panics
func (Option[T]) OrCompute ¶
func (o Option[T]) OrCompute(f func() T) T
OrCompute return the value Option contains. If value is not present, return a value computed by the func.
func (Option[T]) OrElse ¶
func (o Option[T]) OrElse(defaultValue T) T
OrElse return the value Option contains. If value is not present, return a default value.
func (Option[T]) OrNext ¶
OrNext return the Option if it is present. If value is not present, return an Option computed by the func.
Click to show internal directories.
Click to hide internal directories.