result

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result[Ok any] struct {
	// contains filtered or unexported fields
}

Result is a type that represents either a value or an error.

func Err

func Err[Ok any](err error) Result[Ok]

func Map

func Map[A, B any](result Result[A], transformer delegate.Transform[A, B]) Result[B]

func Of

func Of[Ok any](data Ok, err error) Result[Ok]

Of creates a new Result from a value.

func Ok

func Ok[Ok any](data Ok) Result[Ok]

func (Result[Ok]) And

func (self Result[Ok]) And(res Result[Ok]) Result[Ok]

func (Result[Ok]) Error

func (self Result[Ok]) Error() error

func (Result[Ok]) IfErr

func (self Result[Ok]) IfErr(consume delegate.Consumer1[error])

func (Result[Ok]) IfOk

func (self Result[Ok]) IfOk(consume delegate.Consumer1[Ok])

func (Result[Ok]) IsErr

func (self Result[Ok]) IsErr() bool

func (Result[Ok]) IsOk

func (self Result[Ok]) IsOk() bool

func (Result[Ok]) Match

func (self Result[Ok]) Match(consumeOk delegate.Consumer1[Ok], consumeErr delegate.Consumer1[error])

func (Result[T]) Or

func (self Result[T]) Or(res Result[T]) Result[T]

func (Result[Ok]) String added in v0.1.1

func (self Result[Ok]) String() string

func (Result[Ok]) Value

func (self Result[Ok]) Value() Ok

Jump to

Keyboard shortcuts

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