option

package
v1.134.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MPL-2.0 Imports: 1 Imported by: 6

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 {
	Value *T
}

func None

func None[T any]() Option[T]

func Some

func Some[T any](value T) Option[T]

func (Option[T]) IsNone

func (self Option[T]) IsNone() bool

func (Option[T]) IsSome

func (self Option[T]) IsSome() bool

func (Option[T]) MarshalJSON

func (self Option[T]) MarshalJSON() ([]byte, error)

func (*Option[T]) UnmarshalJSON

func (self *Option[T]) UnmarshalJSON(data []byte) error

func (Option[T]) Unwrap

func (self Option[T]) Unwrap() T

func (Option[T]) UnwrapOr

func (self Option[T]) UnwrapOr(or T) T

Jump to

Keyboard shortcuts

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