result

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 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 Empty

type Empty = Result[None]

func EmptyFailure

func EmptyFailure(err error) Empty

func EmptySuccess

func EmptySuccess() Empty

type None

type None struct{}

type Result

type Result[T any] struct {
	Error error
	// contains filtered or unexported fields
}

func Failure

func Failure[T any](err error) Result[T]

func Success

func Success[T any](value T) Result[T]

func (Result[T]) Get

func (r Result[T]) Get() T

func (Result[T]) IsFailure

func (r Result[T]) IsFailure() bool

func (Result[T]) IsSuccess

func (r Result[T]) IsSuccess() bool

func (Result[T]) OrElse

func (r Result[T]) OrElse(f func() Result[T]) Result[T]

Jump to

Keyboard shortcuts

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