option

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 2 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cast

func Cast[TSource, TTarget any](source types.Option[TSource]) types.Result[types.Option[TTarget]]

Cast attempts to cast a source option type of TSource to a result option type of TTarget if the cast fails, Error is returned if the cast succeeds, Ok is returned wrapping the Option[TTarget]

func New

func New[T any](t T, ok bool) types.Option[T]

func None

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

func Some

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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