resultutils

package
v0.1.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlatMapOk added in v0.1.6

func FlatMapOk[T, U any](r mo.Result[T], f func(T) mo.Result[U]) mo.Result[U]

FlatMapOk applies a function that returns a Result to the Ok value of a Result.

func MapOk added in v0.1.6

func MapOk[T, U any](r mo.Result[T], f func(T) U) mo.Result[U]

MapOk applies a function to the Ok value of a Result.

func Tap added in v0.1.7

func Tap[T any](result mo.Result[T], effect func(T)) mo.Result[T]

Tap executes a side-effect function on success without modifying the result

func Then

func Then[T, U any](r mo.Result[T], f func(T) mo.Result[U]) mo.Result[U]

func Then2

func Then2[T, U, V any](r mo.Result[T], f func(T) mo.Result[U], g func(U) mo.Result[V]) mo.Result[V]

func Then3

func Then3[T, U, V, W any](r mo.Result[T], f func(T) mo.Result[U], g func(U) mo.Result[V], h func(V) mo.Result[W]) mo.Result[W]

func Then4

func Then4[T, U, V, W, X any](
	r mo.Result[T],
	f func(T) mo.Result[U],
	g func(U) mo.Result[V],
	h func(V) mo.Result[W],
	i func(W) mo.Result[X],
) mo.Result[X]

func ToPtrResult

func ToPtrResult[T any](r mo.Result[T]) mo.Result[*T]

func ToValue

func ToValue[T any](r mo.Result[*T]) (*T, fault.Fault)

Given a Result[*T] return the value *T

Types

This section is empty.

Jump to

Keyboard shortcuts

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