optional

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Optional

type Optional[T comparable] struct {
	// contains filtered or unexported fields
}

func None

func None[T comparable]() Optional[T]

func Some

func Some[T comparable](value T) Optional[T]

func (Optional[T]) IsNone

func (o Optional[T]) IsNone() bool

func (Optional[T]) IsSame

func (o Optional[T]) IsSame(other Optional[T]) bool

func (Optional[T]) IsSome

func (o Optional[T]) IsSome() bool

func (Optional[T]) OrElse

func (o Optional[T]) OrElse(defaultValue T) T

func (Optional[T]) TryValue

func (o Optional[T]) TryValue() (T, bool)

func (Optional[T]) Value

func (o Optional[T]) Value() T

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL